Skip to content

Commit 2be5ada

Browse files
pytest.ini: Support newer pytest versions (>=7) to fix errors devs face
Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
1 parent dd0c4c1 commit 2be5ada

4 files changed

Lines changed: 10 additions & 22 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,12 @@ dependencies = [
4747
test = [
4848
"mock",
4949
"pyfakefs",
50-
"pytest<7",
50+
"pytest>=7",
5151
"pytest-cov",
5252
"pytest-forked",
5353
"pytest_httpserver; python_version >= '3.7'",
5454
"pytest-localftpserver; python_version >= '3.7'",
5555
"pytest-localftpserver==0.5.1; python_version <= '3.6'",
56-
"pytest-pythonpath",
5756
"pytest-subprocess; python_version >= '3.6'",
5857
"pytest-timeout",
5958
"typing_extensions"

pytest.ini

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
###############################################################################
2-
# pytest.ini for pytest<=6 to be compatible with Python 2.7. Install command:
3-
# pip install pytest<7
4-
###############################################################################
5-
# To use pytest>=7, disable "python_paths" below.
2+
# Configuration file for pytest:
3+
# Compatibility with pytest 6.x for Python 2.7 has been dropped, needs pytest>7
4+
#
5+
# See https://docs.pytest.org for documentation on pytest.
66
###############################################################################
77
[pytest]
8-
# These are the most of the needed pytest plugins, unfortunately this list does
9-
# not support ;python_version<=3.0 or ;python_version>3.0. Therefore, it can
10-
# only list plugins available for all tested python versions (2.7, 3.6 ... 3.11):
11-
# pytest-localftpserver is also used, but its installation is not checked
12-
# to to its installation not being detected on Ubuntu 24.04:
138
required_plugins =
149
pytest_httpserver
10+
pytest_localftpserver
1511
pytest-forked
16-
pytest-pythonpath
1712
pytest-subprocess
1813
pytest-timeout
1914
pyfakefs
@@ -30,13 +25,6 @@ timeout=30
3025
log_cli=True
3126
log_cli_level=INFO
3227
#
33-
# Only effective for pytest<7: Don't warn about new configs for pytest>7:
34-
filterwarnings=ignore:Unknown config option
35-
#
3628
# Add directory to find the example branding.py (needed by bootloader.py) in ./stubs:
37-
#
38-
# Used by for pytest >= 7.0.0 (only available for Python >= 3.0):
39-
pythonpath=stubs
40-
# Disable when using pytest >= 7.0.0:
41-
# Used by pytest-pythonpath for Python >=2.7 (https://pypi.org/project/pytest-pythonpath):
42-
python_paths=stubs
29+
# (Requires pytest >= 7.0.0):
30+
pythonpath=stubs

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def set_warnings():
2828
run-time checking during tests.
2929
3030
By additionally using setenv = PYTHONWARNINGS=ignore in tox.ini,
31-
we can disabling the Deprecation warnings wihch pytest plugins exhibit
31+
we can disable the Deprecation warnings which pytest plugins exhibit
3232
(which we are not interested in, those are not our responsiblity).
3333
and this fixture will still enable the default warning filter to
3434
have e.g. ResourceWarning checks enabled.

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ deps = pylint
163163
diff-cover
164164
pandas
165165
tabulate
166+
toml
166167
commands =
167168
python pylint_runner.py xcp tests
168169
diff-quality --compare-branch=origin/master --violations=pylint \

0 commit comments

Comments
 (0)