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
4 changes: 4 additions & 0 deletions Lib/test/test_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def verbose_print(arg):
with _print_mutex:
print(arg)


class BasicThreadTest(unittest.TestCase):

def setUp(self):
Expand All @@ -31,6 +32,9 @@ def setUp(self):
self.running = 0
self.next_ident = 0

key = support.threading_setup()
self.addCleanup(support.threading_cleanup, *key)


class ThreadRunningTests(BasicThreadTest):

Expand Down
1 change: 1 addition & 0 deletions Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ Eric Groo
Daniel Andrade Groppe
Dag Gruneau
Filip Gruszczyński
Grzegorz Grzywacz
Thomas Guettler
Yuyang Guo
Anuj Gupta
Expand Down
5 changes: 5 additions & 0 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ Tools/Demos
Tests
-----

* bpo-30357: test_thread: setUp() now uses support.threading_setup() and
support.threading_cleanup() to wait until threads complete to avoid
random side effects on following tests. Initial patch written by Grzegorz
Grzywacz.

- bpo-30197: Enhanced functions swap_attr() and swap_item() in the
test.support module. They now work when delete replaced attribute or item
inside the with statement. The old value of the attribute or item (or None
Expand Down