Skip to content

Commit 3eeec87

Browse files
committed
temp: check the skip condition
1 parent fe75b2d commit 3eeec87

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

coverage/env.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
else:
4141
PYPYVERSION = (0,)
4242

43+
# Does this version of Python have a GIL?
44+
GIL = getattr(sys, '_is_gil_enabled', lambda: True)()
45+
4346
# Python behavior.
4447
class PYBEHAVIOR:
4548
"""Flags indicating this Python's behavior."""

tests/test_oddball.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ def once(x): # line 301
213213
@pytest.mark.skipif(not testenv.C_TRACER, reason="Only the C tracer has refcounting issues")
214214
# In fact, sysmon explicitly holds onto all code objects,
215215
# so this will definitely fail with sysmon.
216+
@pytest.mark.skipif(
217+
env.PYVERSION[:2] == (3, 13) and not env.GIL,
218+
reason = "3.13t never frees code objects: https://github.com/python/cpython/pull/131989",
219+
)
216220
@pytest.mark.parametrize("branch", [False, True])
217221
def test_eval_codeobject_leak(self, branch: bool) -> None:
218222
# https://github.com/nedbat/coveragepy/issues/1924
@@ -232,6 +236,7 @@ def test_eval_codeobject_leak(self, branch: bool) -> None:
232236
print(f"Mem delta: {(now - base)//1024}")
233237
base = now
234238
assert any(d < 50 * 1024 for d in deltas)
239+
1/0
235240

236241

237242
class MemoryFumblingTest(CoverageTest):

0 commit comments

Comments
 (0)