You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pytest isn't thread safe and it can be confusing if people expect it to be. We should document this.
Also similarly, the warnings module as a whole isn't thread safe. Temporary directories with named files or directories also have thread safety issues since they're using global state via the file system.
The text was updated successfully, but these errors were encountered:
Non-exhaustive list of pytest tools that are inherently not thread-safe:
the capsys fixture usage (shared sys.stdout/sys.stderr);
the monkeypatch fixture (and another monkeypatching tool, e.g. from unittest.mock);
pytest.warns (because the warnings module is not safe by itself).
Usage of the tmpdir and tmp_path fixture is currently not thread-safe. However, they could probably be thread safe if the temporary folder they create for each test would be created and deleted within the same thread as the thread used to run them.
Pytest isn't thread safe and it can be confusing if people expect it to be. We should document this.
Also similarly, the warnings module as a whole isn't thread safe. Temporary directories with named files or directories also have thread safety issues since they're using global state via the file system.
The text was updated successfully, but these errors were encountered: