-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix DeprecationWarning about
fork()
and multi-threaded processes in…
… unit tests Ensure all threads are properly shutting down in the unit tests. This prevents the following warning: ``` DeprecationWarning: This process (pid=208847) is multi-threaded, use of fork() may lead to deadlocks in the child. ```
- Loading branch information
1 parent
7f518aa
commit 543939b
Showing
4 changed files
with
30 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import threading | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def assert_no_threads_left(): | ||
assert len(threading.enumerate()) == 1 | ||
yield | ||
assert len(threading.enumerate()) == 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters