MCPcopy Index your code
hub / github.com/python/cpython / skip_if_missing

Function skip_if_missing

Lib/test/test_tools/__init__.py:23–30  ·  view source on GitHub ↗
(tool=None)

Source from the content-addressed store, hash-verified

21scriptsdir = os.path.join(toolsdir, 'scripts')
22
23def skip_if_missing(tool=None):
24 if tool:
25 tooldir = os.path.join(toolsdir, tool)
26 else:
27 tool = 'scripts'
28 tooldir = scriptsdir
29 if not os.path.isdir(tooldir):
30 raise unittest.SkipTest(f'{tool} directory could not be found')
31
32@contextlib.contextmanager
33def imports_under_tool(name, *subdirs):

Callers 8

test_freeze.pyFile · 0.90
test_msgfmt.pyFile · 0.90
test_sundry.pyFile · 0.90
test_reindent.pyFile · 0.90
test_i18n.pyFile · 0.90
assertMsgidsEqualMethod · 0.90

Calls 2

joinMethod · 0.45
isdirMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…