Skip to content

Commit 15af6ae

Browse files
committed
Configure PYTHONPATH via pytest configuration file
Previously, the python:test task set PYTHONPATH via environment variable. That approach is fine when running the tests via the task, but meant that PYTHONPATH was not correctly configured when running the tests via the interface of an IDE. Each contributor would be forced to configure their IDE in order to allow it to run the tests successfully. Configuring PYTHONPATH via the pytest.ini file makes this universal.
1 parent 09971ae commit 15af6ae

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

Taskfile.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ tasks:
248248
- task: poetry:install-deps
249249
cmds:
250250
- |
251-
export PYTHONPATH="${PWD}/{{.PYTHON_PROJECT_PATH}}"
252251
poetry run \
253252
coverage run \
254253
--source="{{.PYTHON_PROJECT_PATH}}" \

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ filterwarnings =
88
# --capture=no - disable per-test capture
99
# --tb=long sets the length of the traceback in case of failures
1010
addopts = --capture=no --tb=long --verbose
11+
pythonpath = reportsizedeltas

0 commit comments

Comments
 (0)