feat: test to hot reload newly installed module

This commit is contained in:
Swann
2020-11-03 16:44:42 +01:00
parent 664f7635cc
commit c710111887
+3
View File
@@ -62,6 +62,9 @@ def install_package(name, version):
del env["PIP_REQUIRE_VIRTUALENV"]
subprocess.run([str(PYTHON_PATH), "-m", "pip", "install", f"{name}=={version}"], env=env)
if name in sys.modules:
del sys.modules[name]
def check_package_version(name, required_version):
logging.info(f"Checking {name} version...")
out = subprocess.run([str(PYTHON_PATH), "-m", "pip", "show", name], capture_output=True)