Skip to content

Conversation

@bluetech
Copy link
Member

@bluetech bluetech commented Jun 7, 2024

This fixes unittest test reruns when using plugins like pytest-rerunfailures.

The instance property uses AttributeError to check if the instance needs to be initialized, so del is the correct way to clear it, not setting to None.

Regressed in 8.2.2.

Fix #12424

This fixes unittest test reruns when using plugins like
pytest-rerunfailures.

The `instance` property uses AttributeError to check if the instance
needs to be initialized, so `del` is the correct way to clear it, not
setting to `None`.

Regressed in 8.2.2.
@bluetech bluetech force-pushed the unittest-rerun-assertion branch from d839e0c to de47b73 Compare June 7, 2024 07:21
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Nice, thanks for tackling this!

@bluetech bluetech merged commit f85289b into pytest-dev:main Jun 7, 2024
@bluetech bluetech deleted the unittest-rerun-assertion branch June 7, 2024 23:11
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.

pytest 8.2.2 breaks pytest-rerunfailures for tests that inherit unittest.TestCase

2 participants