Skip to content
Snippets Groups Projects
Commit 541de9e1 authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

Importing submodules (ie. ``parent.child``) will attempt to import ``parent``...

Importing submodules (ie. ``parent.child``) will attempt to import ``parent`` so we must catch that. (Closes: #854670)
parent 8b454a9e
No related branches found
No related tags found
No related merge requests found
......@@ -63,7 +63,12 @@ def get_supported_elf_formats():
def skip_unless_module_exists(name):
def module_exists(x):
return importlib.util.find_spec(x) is None
try:
return importlib.util.find_spec(x) is None
except ImportError:
# Probing for submodules (eg. ``debian.deb822``) will attempt to
# import ``debian`` so we must handle that failing.
return False
return pytest.mark.skipif(
module_exists(name),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment