Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ NEXT

Improvements
------------
* Clear ``force_failure`` in ``_reset()`` so that re-running a test
after an ``expectThat`` failure can succeed if successful conditions are met again.
(OumarCamara, #563)

* Make ``extract_result()`` and ``DeferredNotFired`` public APIs in
``testtools.twistedsupport``. These utilities are useful for extracting
Expand Down
3 changes: 3 additions & 0 deletions testtools/testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ def _reset(self) -> None:
# __details is lazy-initialized so that a constructed-but-not-run
# TestCase is safe to use with clone_test_with_new_id.
self.__details: DetailsDict | None = None
# force_failure is set by expectThat() on mismatch; must be
# cleared so re-runs of the same test can succeed.
self.force_failure: bool | None = None

def __eq__(self, other: object) -> bool:
eq = getattr(unittest.TestCase, "__eq__", None)
Expand Down