Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_register_invalid_check(self):
class InvalidChecker(DummyChecker):
def __init__(self, filename):
pass
def check_dummy(logical, tokens):
if False:
yield
pycodestyle.register_check(InvalidChecker, ['Z741'])
pycodestyle.register_check(check_dummy, ['Z441'])
for checkers in pycodestyle._checks.values():
self.assertTrue(DummyChecker not in checkers)
self.assertTrue(check_dummy not in checkers)
self.assertRaises(TypeError, pycodestyle.register_check)
def test_register_invalid_check(self):
class InvalidChecker(DummyChecker):
def __init__(self, filename):
pass
def check_dummy(logical, tokens):
if False:
yield
pycodestyle.register_check(InvalidChecker, ['Z741'])
pycodestyle.register_check(check_dummy, ['Z441'])
for checkers in pycodestyle._checks.values():
self.assertTrue(DummyChecker not in checkers)
self.assertTrue(check_dummy not in checkers)
self.assertRaises(TypeError, pycodestyle.register_check)
def test_register_invalid_check(self):
class InvalidChecker(DummyChecker):
def __init__(self, filename):
pass
def check_dummy(logical, tokens):
if False:
yield
pycodestyle.register_check(InvalidChecker, ['Z741'])
pycodestyle.register_check(check_dummy, ['Z441'])
for checkers in pycodestyle._checks.values():
self.assertTrue(DummyChecker not in checkers)
self.assertTrue(check_dummy not in checkers)
self.assertRaises(TypeError, pycodestyle.register_check)