Skip to content

Commit 9d486d2

Browse files
committed
unittest: add skipIfGraalPython decorator
1 parent b3073a3 commit 9d486d2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

graalpython/lib-python/3/test/test_set.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def test_badcmp(self):
309309
self.assertRaises(RuntimeError, s.discard, BadCmp())
310310
self.assertRaises(RuntimeError, s.remove, BadCmp())
311311

312-
@unittest.skipIf(sys.implementation.name == 'graalpython', 'Functionality not yet supported')
312+
@unittest.skipIfGraalPython()
313313
def test_cyclical_repr(self):
314314
w = ReprWrapper()
315315
s = self.thetype([w])
@@ -320,7 +320,7 @@ def test_cyclical_repr(self):
320320
name = repr(s).partition('(')[0] # strip class name
321321
self.assertEqual(repr(s), '%s({%s(...)})' % (name, name))
322322

323-
@unittest.skipIf(sys.implementation.name == 'graalpython', 'Functionality not yet supported')
323+
@unittest.skipIfGraalPython()
324324
def test_cyclical_print(self):
325325
w = ReprWrapper()
326326
s = self.thetype([w])

graalpython/lib-python/3/unittest/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def testMultiply(self):
4343
AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
4444
SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
4545
"""
46+
import sys
4647

4748
__all__ = ['TestResult', 'TestCase', 'TestSuite',
4849
'TextTestRunner', 'TestLoader', 'FunctionTestCase', 'main',
@@ -76,3 +77,7 @@ def load_tests(loader, tests, pattern):
7677
# top level directory cached on loader instance
7778
this_dir = os.path.dirname(__file__)
7879
return loader.discover(start_dir=this_dir, pattern=pattern)
80+
81+
82+
def skipIfGraalPython():
83+
return skipIf(sys.implementation.name == 'graalpython', 'Functionality not yet supported')

0 commit comments

Comments
 (0)