Skip to content

Instantly share code, notes, and snippets.

@megies
Last active February 10, 2016 15:26
Show Gist options
  • Save megies/ccfb499eafdef14c22e1 to your computer and use it in GitHub Desktop.
Save megies/ccfb499eafdef14c22e1 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
import warnings
from importlib import import_module
warnings.simplefilter("ignore")
# print sys.argv[1:]
# for is_module, object_name, _, module_name in sys.argv[1:]:
is_module, object_name, _, module_name = sys.argv[1].split(",")
# is_module = is_module == "module:"
try:
getattr(import_module(module_name), object_name)
except Exception as e:
print("FAIL: {} from {} ({})".format(object_name, module_name, str(e)))
else:
print("OK: {} from {}".format(object_name, module_name))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment