aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/hypothesis/py3/_hypothesis_pytestplugin.py
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-02-02 12:59:30 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-02-02 13:19:24 +0300
commit8319f36af9daf8a45767bcdf088aa257d6258083 (patch)
tree2a030e3466e9cf3eed7f3ebb11163ee3b0577d48 /contrib/python/hypothesis/py3/_hypothesis_pytestplugin.py
parent1f22973dc28fb6b54a1e0827cae6f5dec464945b (diff)
downloadydb-8319f36af9daf8a45767bcdf088aa257d6258083.tar.gz
Intermediate changes
Diffstat (limited to 'contrib/python/hypothesis/py3/_hypothesis_pytestplugin.py')
-rw-r--r--contrib/python/hypothesis/py3/_hypothesis_pytestplugin.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/contrib/python/hypothesis/py3/_hypothesis_pytestplugin.py b/contrib/python/hypothesis/py3/_hypothesis_pytestplugin.py
index 944304ccdb5..e82b528bb53 100644
--- a/contrib/python/hypothesis/py3/_hypothesis_pytestplugin.py
+++ b/contrib/python/hypothesis/py3/_hypothesis_pytestplugin.py
@@ -101,7 +101,6 @@ else:
# need balanced increment/decrement in configure/sessionstart to support nested
# pytest (e.g. runpytest_inprocess), so this early increment in effect replaces
# the first one in pytest_configure.
- _configured = False
if not os.environ.get("HYPOTHESIS_EXTEND_INITIALIZATION"):
_hypothesis_globals.in_initialization += 1
if "hypothesis" in sys.modules:
@@ -163,12 +162,6 @@ else:
return f"hypothesis profile {settings._current_profile!r}{settings_str}"
def pytest_configure(config):
- global _configured
- # skip first increment because we pre-incremented at import time
- if _configured:
- _hypothesis_globals.in_initialization += 1
- _configured = True
-
config.addinivalue_line("markers", "hypothesis: Tests which use hypothesis.")
if not _any_hypothesis_option(config):
return
@@ -430,6 +423,7 @@ else:
item.add_marker("hypothesis")
def pytest_sessionstart(session):
+ # Note: may be called multiple times, so we can go negative
_hypothesis_globals.in_initialization -= 1
# Monkeypatch some internals to prevent applying @pytest.fixture() to a