How to use vermin - 10 common examples

To help you get started, we’ve selected a few vermin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github netromdk / vermin / tests / general.py View on Github external
def test_main_no_rules_hit(self):
    # Python file that doesn't hit any rules should exit successfully.
    fp = NamedTemporaryFile(suffix=".py", delete=False)
    fp.close()
    with self.assertRaises(SystemExit) as ex:
      sys.argv = [sys.argv[0], fp.name]
      main()
    os.remove(fp.name)
    sys.argv = [sys.argv[0]]
    self.assertEqual(ex.exception.code, 0)
github netromdk / vermin / tests / exclusions.py View on Github external
def __init__(self, methodName):
    super(VerminExclusionsTests, self).__init__(methodName)
    self.config = Config.get()
github netromdk / vermin / tests / general.py View on Github external
def __init__(self, methodName):
    super(VerminGeneralTests, self).__init__(methodName)
    self.config = Config.get()
github netromdk / vermin / tests / constants.py View on Github external
def __init__(self, methodName):
    super(VerminConstantMemberTests, self).__init__(methodName)
    self.config = Config.get()
github netromdk / vermin / tests / arguments.py View on Github external
def __init__(self, methodName):
    super(VerminArgumentsTests, self).__init__(methodName)
    self.config = Config.get()
github netromdk / vermin / tests / lax_mode.py View on Github external
def __init__(self, methodName):
    super(VerminLaxModeTests, self).__init__(methodName)
    self.config = Config.get()
github netromdk / vermin / tests / function.py View on Github external
def __init__(self, methodName):
    super(VerminFunctionMemberTests, self).__init__(methodName)
    self.config = Config.get()
github netromdk / vermin / tests / class.py View on Github external
def __init__(self, methodName):
    super(VerminClassMemberTests, self).__init__(methodName)
    self.config = Config.get()
github netromdk / vermin / tests / general.py View on Github external
def test_detect_hidden_paths(self):
    tmp_fld = mkdtemp()
    files = [touch(tmp_fld, ".test.py"), touch(tmp_fld, "test.py"), touch(tmp_fld, ".test2.py"),
             touch(tmp_fld, "test2.py")]

    paths = detect_paths([tmp_fld], hidden=False)
    without_dot = [files[1], files[3]]
    self.assertEqualItems(without_dot, paths)

    paths2 = detect_paths([tmp_fld], hidden=True)
    self.assertEqualItems(files, paths2)

    rmtree(tmp_fld)
github netromdk / vermin / tests / general.py View on Github external
def test_detect_vermin_min_versions(self):
    paths = detect_paths([abspath("vermin")])
    processor = Processor()
    (mins, incomp, unique_versions, backports) = processor.process(paths)
    self.assertOnlyIn(((2, 7), (3, 0)), mins)
    self.assertEmpty(backports)