Skip to content

Commit

Permalink
Fix pytest and tox
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliottKasoar committed Mar 19, 2024
1 parent 99ab066 commit a91610b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ filterwarnings = [
"ignore::DeprecationWarning:plumpy:",
"ignore::DeprecationWarning:yaml:",
]
pythonpath = ["."]

[tool.coverage.run]
# Configuration of [coverage.py](https://coverage.readthedocs.io)
Expand Down
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import os
from pathlib import Path
import shutil

import pytest

Expand Down Expand Up @@ -93,7 +94,7 @@ def janus_code(aiida_local_code_factory):
`Code`
The janus code instance.
"""
janus_path = os.environ.get("JANUS_PATH")
janus_path = shutil.which("janus") or os.environ.get("JANUS_PATH")
return aiida_local_code_factory(executable=janus_path, entry_point="janus.sp")


Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = Run the test suite against Python versions
allowlist_externals = poetry, sh
commands_pre = poetry install --no-root --sync
# Export path to janus executable installed in tox environment before running pytest
commands = sh -c 'export JANUS_PATH=$(which janus); exec "$@"' _ poetry run pytest --cov aiida_mlip --import-mode importlib
commands = sh -c 'export JANUS_PATH=$(which janus); exec "$@"' _ poetry run pytest {posargs} --cov aiida_mlip --import-mode importlib

[testenv:pre-commit]
description = Run the pre-commit checks
Expand Down

0 comments on commit a91610b

Please sign in to comment.