File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
1
UNRELEASED
2
2
----------
3
3
4
+ - Use ``pytest.hookimpl `` to configure hooks, avoiding a deprecation warning in
5
+ the upcoming pytest 7.2.0.
6
+
4
7
4.1.0 (2022-06-23)
5
8
------------------
6
9
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ def pytest_runtest_setup(self, item):
39
39
item .qt_log_capture = _QtMessageCapture (ignore_regexes )
40
40
item .qt_log_capture ._start ()
41
41
42
- @pytest .mark . hookwrapper
42
+ @pytest .hookimpl ( hookwrapper = True )
43
43
def pytest_runtest_makereport (self , item , call ):
44
44
"""Add captured Qt messages to test item report if the call failed."""
45
45
outcome = yield
Original file line number Diff line number Diff line change @@ -157,8 +157,7 @@ def pytest_addoption(parser):
157
157
)
158
158
159
159
160
- @pytest .mark .hookwrapper
161
- @pytest .mark .tryfirst
160
+ @pytest .hookimpl (hookwrapper = True , tryfirst = True )
162
161
def pytest_runtest_setup (item ):
163
162
"""
164
163
Hook called after before test setup starts, to start capturing exceptions
@@ -174,8 +173,7 @@ def pytest_runtest_setup(item):
174
173
item .qt_exception_capture_manager .fail_if_exceptions_occurred ("SETUP" )
175
174
176
175
177
- @pytest .mark .hookwrapper
178
- @pytest .mark .tryfirst
176
+ @pytest .hookimpl (hookwrapper = True , tryfirst = True )
179
177
def pytest_runtest_call (item ):
180
178
yield
181
179
_process_events ()
@@ -184,8 +182,7 @@ def pytest_runtest_call(item):
184
182
item .qt_exception_capture_manager .fail_if_exceptions_occurred ("CALL" )
185
183
186
184
187
- @pytest .mark .hookwrapper
188
- @pytest .mark .trylast
185
+ @pytest .hookimpl (hookwrapper = True , trylast = True )
189
186
def pytest_runtest_teardown (item ):
190
187
"""
191
188
Hook called after each test tear down, to process any pending events and
Original file line number Diff line number Diff line change @@ -541,7 +541,7 @@ def test_logging_broken_makereport(testdir):
541
541
conftest = """
542
542
import pytest
543
543
544
- @pytest.mark.hookwrapper( tryfirst=True)
544
+ @pytest.hookimpl(hookwrapper=True, tryfirst=True)
545
545
def pytest_runtest_makereport(call):
546
546
if call.when == 'call':
547
547
raise Exception("This should not be hidden")
You can’t perform that action at this time.
0 commit comments