We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c21b76d commit 2434bfeCopy full SHA for 2434bfe
tests/test_imports.py
@@ -28,6 +28,11 @@ def test_web___all__(pytester: pytest.Pytester) -> None:
28
result.assert_outcomes(passed=0, errors=0)
29
30
31
+_TARGET_TIMINGS_BY_PYTHON_VERSION = {
32
+ "3.12": 250, # 3.12 is expected to be a bit slower due to performance trade-offs
33
+}
34
+
35
36
@pytest.mark.skipif(
37
not sys.platform.startswith("linux") or platform.python_implementation() == "PyPy",
38
reason="Timing is more reliable on Linux",
@@ -59,4 +64,7 @@ def test_import_time(pytester: pytest.Pytester) -> None:
59
64
else:
60
65
os.environ["PYTHONPATH"] = old_path
61
66
62
- assert best_time_ms < 200
67
+ expected_time = _TARGET_TIMINGS_BY_PYTHON_VERSION.get(
68
+ f"{sys.version_info.major}.{sys.version_info.minor}", 200
69
+ )
70
+ assert best_time_ms < expected_time
0 commit comments