Last active
December 5, 2015 01:06
-
-
Save paulohrpinheiro/3a650e0099df2254b086 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
import inspect | |
import importlib | |
import app_config # my config for this application | |
class RequirementsTestCase(unittest.TestCase): | |
def test_requirement_exist(self): | |
with open(app_config.REQUIREMENTS) as f: # this config option is the complete file name in project, a requirements.txt | |
for req_name in f: | |
module_instance = importlib.import_module(req_name.strip()) # strip, strip, strip! | |
self.assertTrue(inspect.ismodule(module_instance)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment