MCPcopy Index your code
hub / github.com/RustPython/RustPython / loadTestsOrSkip

Function loadTestsOrSkip

extra_tests/jsontests.py:13–24  ·  view source on GitHub ↗
(loader, name)

Source from the content-addressed store, hash-verified

11
12
13def loadTestsOrSkip(loader, name):
14 try:
15 return loader.loadTestsFromName(name)
16 except unittest.SkipTest as exc:
17 # from _make_skipped_test from unittest/loader.py
18 @unittest.skip(str(exc))
19 def testSkipped(self):
20 pass
21
22 attrs = {name: testSkipped}
23 TestClass = type("ModuleSkipped", (unittest.TestCase,), attrs)
24 return loader.suiteClass((TestClass(name),))
25
26
27loader = unittest.defaultTestLoader

Callers 1

jsontests.pyFile · 0.85

Calls 2

loadTestsFromNameMethod · 0.80
TestClassClass · 0.50

Tested by

no test coverage detected