How to use the vermin.Backports function in vermin

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 / backports.py View on Github external
def test_modules(self):
    self.assertEqualItems((
      "argparse",
      "configparser",
      "enum",
      "faulthandler",
      "typing",
    ), Backports.modules())
github netromdk / vermin / tests / arguments.py View on Github external
def test_backport(self):
    # Needs  part.
    self.assertContainsDict({"code": 1}, parse_args(["--backport"]))
    self.assertEmpty(self.config.backports())

    # Unknown module.
    self.assertContainsDict({"code": 1}, parse_args(["--backport", "foobarbaz"]))
    self.assertEmpty(self.config.backports())

    # Known modules.
    for mod in Backports.modules():
      self.config.reset()
      self.assertContainsDict({"code": 0}, parse_args(["--backport", mod]))
      self.assertEqualItems([mod], self.config.backports())
github netromdk / vermin / tests / backports.py View on Github external
def test_is_backport(self):
    for mod in Backports.modules():
      self.assertTrue(Backports.is_backport(mod))