Skip to content

Commit 99850b8

Browse files
committed
switch to assert list empty for a better assertion error message
1 parent e48d0e0 commit 99850b8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Lib/test/test_concurrent_futures/executor.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,12 @@ def test_map_exception(self):
6969

7070
# a failed future must not be captured in its
7171
# future._exception.__traceback__ to avoid a reference cycle
72-
self.assertTrue(
73-
all(
74-
not isinstance(referrer, futures.Future)
72+
self.assertFalse(
73+
[
74+
referrer
7575
for referrer in gc.get_referrers(error)
76-
),
76+
if isinstance(referrer, futures.Future)
77+
],
7778
msg="none of the referrers should be a Future",
7879
)
7980

0 commit comments

Comments
 (0)