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

Function requires_resource

Lib/test/support/__init__.py:1338–1344  ·  view source on GitHub ↗
(resource)

Source from the content-addressed store, hash-verified

1336 return obj
1337
1338def requires_resource(resource):
1339 if resource == 'gui' and not _is_gui_available():
1340 return unittest.skip(_is_gui_available.reason)
1341 if is_resource_enabled(resource):
1342 return _id
1343 else:
1344 return unittest.skip("resource {0!r} is not enabled".format(resource))
1345
1346def cpython_only(test):
1347 """

Callers

nothing calls this directly

Calls 4

_is_gui_availableFunction · 0.85
is_resource_enabledFunction · 0.85
skipMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…