def main(): here = os.path.abspath(os.path.dirname(__file__)) path = os.path.join(here, "print_announce.py") get_changes = import_module_by_path(path).get_changes with open(os.path.expanduser("~/.tidelift.token")) as f: token = f.read().strip() upload_relnotes('psutil', psutil.__version__, get_changes(), token)
def test_setup_script(self): setup_py = os.path.join(ROOT_DIR, 'setup.py') if TRAVIS and not os.path.exists(setup_py): return self.skipTest("can't find setup.py") module = import_module_by_path(setup_py) self.assertRaises(SystemExit, module.setup) self.assertEqual(module.get_version(), psutil.__version__)
def _iter_testmod_classes(self): """Iterate over all test files in this directory and return all TestCase classes in them. """ for path in self._get_testmods(): mod = import_module_by_path(path) for name in dir(mod): obj = getattr(mod, name) if isinstance(obj, type) and \ issubclass(obj, unittest.TestCase): yield obj
def test_setup_script(self): setup_py = os.path.join(ROOT_DIR, 'setup.py') module = import_module_by_path(setup_py) self.assertRaises(SystemExit, module.setup) self.assertEqual(module.get_version(), psutil.__version__)