Skip to content

Commit 24d47d3

Browse files
committed
fix running pytest in github and locally with pytest 8.0.0
1 parent 1581c53 commit 24d47d3

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

.github/workflows/check-datasources.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
2929
- name: "[DE/BNA] Data retrieval check"
3030
run: |
31-
pytest tests/integration/test_int_de_bna.py
31+
python -m pytest tests/integration/test_int_de_bna.py
3232
3333
- name: "[FR] Data retrieval check"
3434
run: |
35-
pytest tests/integration/test_int_fr_france.py
35+
python -m pytest tests/integration/test_int_fr_france.py

.github/workflows/python-app.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ jobs:
4545
- name: Run tests
4646
run: |
4747
pip install -r test/requirements.txt
48-
pytest -m "not check_datasource"
48+
python -m pytest -m "not check_datasource"

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,14 @@ Before you run the tests you need to install test dependencies by
193193
pip install -r test/requirements.txt
194194
```
195195

196-
You can run all tests under `/test` by running the following command:
196+
You can run all tests by running the following command:
197197

198198
```bash
199199
# to run all tests, use:
200-
pytest
200+
python -m pytest
201201

202202
# ... or the following to run only the unit tests, i.e. not the integration tests (which run a bit longer):
203-
pytest -m 'not integration_test' -W ignore::DeprecationWarning
203+
python -m pytest -m 'not integration_test'
204204
```
205205

206206
#### Testdata import / Integration test for the merger

pyproject.toml

+9-5
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,20 @@ requires = [
1515
build-backend = "setuptools.build_meta"
1616

1717
[tool.pytest.ini_options]
18-
19-
# Set logging for code under test
20-
addopts = "--verbose --capture=no --log-cli-level=DEBUG --log-cli-format='%(asctime)s %(levelname)s %(message)s' --log-cli-date-format='%Y-%m-%d %H:%M:%S' -W ignore::DeprecationWarning"
21-
18+
addopts = [
19+
"--import-mode=importlib",
20+
"--capture=no",
21+
"--log-level=WARN",
22+
"--log-cli-level=DEBUG",
23+
"--log-cli-format='%(asctime)s %(levelname)s %(message)s'",
24+
"--log-cli-date-format='%Y-%m-%d %H:%M:%S'",
25+
"-W ignore::DeprecationWarning"
26+
]
2227
# Limit search for tests to following folders
2328
testpaths = [
2429
"test", # TODO: move content to tests/unit/ folder
2530
"tests",
2631
]
27-
2832
# Declare custom markers
2933
markers = [
3034
"integration_test: marks tests as integration tests (deselect with '-m \"not integration_test\"')",

0 commit comments

Comments
 (0)