Skip to content

Commit 8d2f0a9

Browse files
committed
HPy: add tp_traverse marker to skip tests for impls that do not use it
1 parent 10c5cc2 commit 8d2f0a9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

graalpython/lib-graalpython/modules/hpy/test/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,18 @@ def pytest_configure(config):
4545
config.addinivalue_line(
4646
"markers", "syncgc: Mark tests that rely on a synchronous GC."
4747
)
48+
config.addinivalue_line(
49+
"markers", "tp_traverse: Mark tests that rely tp_traverse being called."
50+
)
4851

4952

5053
def pytest_runtest_setup(item):
5154
if (sys.implementation.name in ["graalpython", "pypy"] and
5255
"syncgc" in [mark.name for mark in item.iter_markers()]):
5356
pytest.skip(f"cannot run syncgc test on {sys.implementation.name}")
57+
if (sys.implementation.name in ["graalpython"] and
58+
"tp_traverse" in [mark.name for mark in item.iter_markers()]):
59+
pytest.skip(f"{sys.implementation.name} does not call tp_traverse")
5460

5561

5662
@pytest.fixture(scope='session')

graalpython/lib-graalpython/modules/hpy/test/test_hpyfield.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def test_gc_track_no_gc_flag(self):
144144
p = mod.Pair("hello", "world")
145145
assert not gc.is_tracked(p)
146146

147+
@pytest.mark.tp_traverse
147148
def test_tp_traverse(self):
148149
import sys
149150
import gc

0 commit comments

Comments
 (0)