Skip to content

Commit

Permalink
CURRENT_TEST_DIRECTORY -> PYPOP_CURRENT_TEST_DIRECTORY
Browse files Browse the repository at this point in the history
* don't check `PYTEST_VERSION`: doesn't work on older `pytest`
  • Loading branch information
alexlancaster committed Jan 18, 2025
1 parent 25520bc commit 8490cf1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/PyPop/Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ def get_sequence_directory(directory_str, debug=False):
if not path_obj.is_absolute():
if path_obj.exists() and path_obj.is_dir():
path_obj = path_obj.resolve()
elif os.environ.get("CURRENT_TEST_DIRECTORY") and os.environ.get(
"PYTEST_VERSION"
):
elif os.environ.get("PYPOP_CURRENT_TEST_DIRECTORY"):
# if we're running in a test environment, resolve paths relative to the parent of the "tests" directory
path_obj = Path(os.environ.get("CURRENT_TEST_DIRECTORY")).parent / path_obj
path_obj = (
Path(os.environ.get("PYPOP_CURRENT_TEST_DIRECTORY")).parent / path_obj
)
else:
sys.exit(
f"Relative path {path_obj} for AnthonyNolan sequence files does not exist or is not a directory."
Expand Down

0 comments on commit 8490cf1

Please sign in to comment.