Skip to content

Fix crash in runtest teardown hook#207

Merged
icemac merged 6 commits intopytest-dev:masterfrom
lukasNebr:fix_crash_runtest_teardown
Feb 17, 2023
Merged

Fix crash in runtest teardown hook#207
icemac merged 6 commits intopytest-dev:masterfrom
lukasNebr:fix_crash_runtest_teardown

Conversation

@lukasNebr
Copy link
Copy Markdown
Contributor

This PR refers to issue #206

I improved the implementation of the pytest runtest hook. Now the hook is compatible with test cases that use the TestCase class as base class. This fixes this error.

In addition I added a check to avoid this attribute error. It is clear that this does not fix the general problem with hooks beeing overwritten by other plugins.

@lukasNebr lukasNebr marked this pull request as ready for review February 16, 2023 22:13
Copy link
Copy Markdown
Contributor

@icemac icemac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some little changes.

Thank you for this PR.

Comment thread CHANGES.rst Outdated
Comment thread CHANGES.rst Outdated
Comment thread pytest_rerunfailures.py Outdated
@icemac icemac merged commit cb1234d into pytest-dev:master Feb 17, 2023
@icemac
Copy link
Copy Markdown
Contributor

icemac commented Feb 17, 2023

@lukasNebr lukasNebr deleted the fix_crash_runtest_teardown branch February 17, 2023 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError: 'TestCaseFunction' object has no attribute 'execution_count'

2 participants