Skip to content

Conversation

@bluetech
Copy link
Member

Fix #12367.

assert passed + skipped + failed == 2


def test_teardown_issue1649(pytester: Pytester) -> None:
Copy link
Member Author

Choose a reason for hiding this comment

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

The way this test was written previously wasn't good; it checked if the obj is still alive after the pytester run, at which the entire session was torn down, too late. This fixes it up. I made sure it now fails before and passes after.

super().setup()

def teardown(self) -> None:
super().teardown()
Copy link
Member Author

@bluetech bluetech May 25, 2024

Choose a reason for hiding this comment

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

This change isn't really related and doesn't have any effect because the super call doesn't do anything, but nonetheless teardown must be done in reverse order, so I fixed it just in case the super ever starts doing something.

@bluetech bluetech force-pushed the unittest-clear-instance branch from ff9caa8 to c3c5103 Compare May 26, 2024 07:18
@bluetech bluetech merged commit f8dfc1d into pytest-dev:main May 26, 2024
@bluetech bluetech deleted the unittest-clear-instance branch May 26, 2024 07:34
@mdmintz
Copy link

mdmintz commented Jun 5, 2024

@bluetech I think these changes caused #12424

@marcoep marcoep mentioned this pull request Jun 8, 2024
4 tasks
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.

Unittest class instances no longer released on test teardown since pytest 8.2.0

3 participants