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
committerAlexander Smirnov <alex@ydb.tech>2024-02-09 19:17:14 +0300
commitd299e8854d8ffcea39aa93e6c807bdb93a0821ae (patch)
tree0fc7c5a9ceb08ce19367c0fed8a9d589a650df53 /contrib/python/hypothesis/py3/_hypothesis_pytestplugin.py
parent2294e1cc7147afff7407d26b0ab809b5dab8f8b8 (diff)
downloadydb-d299e8854d8ffcea39aa93e6c807bdb93a0821ae.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