Skip to content

Commit a6de5ff

Browse files
committed
Avoid using deprecated get_marker function
https://github.com/pytest-dev/pytest/blob/master/doc/en/mark.rst#updating-code Need Pytest version to 3.6.0: introduced by commit pytest-dev/pytest@4914135
1 parent baf3e4f commit a6de5ff

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ System requirements
2323
+ Python 2.6, 2.7, or 3.3 and newer.
2424
Python 2.6 requires patching the sources, see below.
2525
+ `setuptools`_.
26-
+ `pytest`_ 2.8.0 or newer.
26+
+ `pytest`_ 3.6.0 or newer.
2727

28-
(Python 3.1 is not supported by pytest 2.8.0 itself.)
28+
(Python 3.2 is not supported by pytest 3.6.0 itself.)
2929

3030

3131
Installation

doc/src/configuration.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ Configuration file options can be set in the `ini file`.
2121

2222
minversion
2323
This is a builtin configuration option of pytest itself. Since
24-
pytest-dependency requires pytest 2.8.0 or newer, it is recommended
25-
to set this option accordingly, either to 2.8.0 or to a newer
24+
pytest-dependency requires pytest 3.6.0 or newer, it is recommended
25+
to set this option accordingly, either to 3.6.0 or to a newer
2626
version, if required by your test code.
2727

2828
automark_dependency

doc/src/install.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ System requirements
77
+ Python 2.6, 2.7, or 3.3 and newer.
88
Python 2.6 requires patching the sources, see below.
99
+ `setuptools`_.
10-
+ `pytest`_ 2.8.0 or newer.
10+
+ `pytest`_ 3.6.0 or newer.
1111

12-
(Python 3.1 is not supported by pytest 2.8.0 itself.)
12+
(Python 3.2 is not supported by pytest 3.6.0 itself.)
1313

1414

1515
.. _install-other-packages:

pytest_dependency.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def pytest_runtest_makereport(item, call):
128128
"""Store the test outcome if this item is marked "dependency".
129129
"""
130130
outcome = yield
131-
marker = item.get_marker("dependency")
131+
marker = item.get_closest_marker("dependency")
132132
if marker is not None or _automark:
133133
rep = outcome.get_result()
134134
name = marker.kwargs.get('name') if marker is not None else None
@@ -140,7 +140,7 @@ def pytest_runtest_setup(item):
140140
"""Check dependencies if this item is marked "dependency".
141141
Skip if any of the dependencies has not been run successfully.
142142
"""
143-
marker = item.get_marker("dependency")
143+
marker = item.get_closest_marker("dependency")
144144
if marker is not None:
145145
depends = marker.kwargs.get('depends')
146146
if depends:

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pytest >=2.8.0
1+
pytest >=3.6.0

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def make_release_tree(self, base_dir, files):
6060
'Source Code': 'https://github.com/RKrahl/pytest-dependency',
6161
},
6262
py_modules=['pytest_dependency'],
63-
install_requires=['pytest >= 2.8.0'],
63+
install_requires=['pytest >= 3.6.0'],
6464
classifiers=[
6565
'Development Status :: 4 - Beta',
6666
'Framework :: Pytest',

tests/pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[pytest]
2-
minversion = 2.8
2+
minversion = 3.6

0 commit comments

Comments
 (0)