Skip to content

Commit

Permalink
fix(tests): get tests working for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
n-dusan committed Oct 29, 2023
1 parent 6ce3361 commit dea62f2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ include_package_data = True
package_dir =
upgrade = upgrade
test_suite = tests
setup_requires = setuptools_scm < 7.0.0;
setup_requires = setuptools_scm

[options.extras_require]
dev =
Expand Down
4 changes: 2 additions & 2 deletions upgrade/scripts/manage_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ def ensure_pip(venv_executable, *args, **kwargs):
try:
return run(*((venv_executable, "-m", "ensurepip") + args), **kwargs)
except subprocess.CalledProcessError as e:
logging.error("Error occurred while running pip in venv %s", str(e))
logging.error(f"Error occurred while running pip in venv {str(e)}")
raise e


def venv(*args, **kwargs):
try:
return run(*((sys.executable, "-m", "venv", "--without-pip") + args), **kwargs)
except subprocess.CalledProcessError as e:
logging.error("Error occurred while creating venv %s", str(e))
logging.error(f"Error occurred while creating venv {str(e)}" )
raise e


Expand Down
2 changes: 1 addition & 1 deletion upgrade/scripts/slack.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

import pip._vendor.requests as requests
import requests

from .exceptions import SlackError

Expand Down
2 changes: 1 addition & 1 deletion upgrade/scripts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_venv_executable(venv_path: str) -> str:
if is_windows():
return str(Path(venv_path, "Scripts", "python.exe").absolute())
else:
return str(Path(venv_path, "bin", "python").absolute())
return str(Path(venv_path, "bin", "python3").absolute())


def is_windows() -> bool:
Expand Down
15 changes: 9 additions & 6 deletions upgrade/tests/manage_venv/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,14 @@ def mock_package_index_html():


def install_upgrade_python_package(venv_executable, upgrade_python_package_version):
breakpoint()
run(
venv_executable,
"-m",
"pip",
"install",
"-e",
f"{str(UPGRADE_PYTHON_PACKAGE_REPOSITORY_PATH)}",
*([
venv_executable,
"-m",
"pip",
"install",
"-e",
f"{str(UPGRADE_PYTHON_PACKAGE_REPOSITORY_PATH)}",
])
)

0 comments on commit dea62f2

Please sign in to comment.