Skip to content

Commit

Permalink
Prepare tests for upcoming twisted version
Browse files Browse the repository at this point in the history
Twisted recently changed behavior of logger on failures [1]. It newly
logs the `Main loop terminated.` even on exceptions, which breaks two
test in twistedsupport test suite. This hack attempts to address the
upcoming issue.

[1] twisted/twisted#12207
  • Loading branch information
arkamar committed Jul 1, 2024
1 parent 00a60b3 commit 6ad79b3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions testtools/tests/twistedsupport/test_runtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
Contains,
ContainsAll,
ContainsDict,
EndsWith,
Equals,
Is,
KeysEqual,
Expand Down Expand Up @@ -749,7 +748,7 @@ def test_something(self):
test,
{
"traceback": Not(Is(None)),
"twisted-log": AsText(EndsWith(" foo\n")),
"twisted-log": AsText(Contains(" foo\n")),
},
),
("stopTest", test),
Expand Down Expand Up @@ -790,7 +789,7 @@ def test_something(self):
result = self.make_result()
runner.run(result)
self.assertThat(
messages, MatchesListwise([ContainsDict({"message": Equals(("foo",))})])
messages[0:1], MatchesListwise([ContainsDict({"message": Equals(("foo",))})])
)

def test_restore_observers(self):
Expand Down

0 comments on commit 6ad79b3

Please sign in to comment.