def test_set_unsupported_reporter(linter: PyLinter) -> None: text.register(linter) # ImportError with pytest.raises(exceptions.InvalidReporterError): linter.set_option("output-format", "missing.module.Class") # AssertionError with pytest.raises(exceptions.InvalidReporterError): linter.set_option("output-format", "lint.unittest_lint._CustomPyLinter") # AttributeError with pytest.raises(exceptions.InvalidReporterError): linter.set_option("output-format", "lint.unittest_lint.MyReporter")
def test_set_unsupported_reporter(linter): text.register(linter) with pytest.raises(exceptions.InvalidReporterError): linter.set_option("output-format", "missing.module.Class")
def test_report_output_format_aliased(linter): text.register(linter) linter.set_option("output-format", "text") assert linter.reporter.__class__.__name__ == "TextReporter"
def test_report_output_format_aliased(self): text.register(self.linter) self.linter.set_option('output-format', 'text') self.assertEqual(self.linter.reporter.__class__.__name__, 'TextReporter')
def test_set_unsupported_reporter(linter): text.register(linter) with pytest.raises(exceptions.InvalidReporterError): linter.set_option('output-format', 'missing.module.Class')
def test_report_output_format_aliased(linter): text.register(linter) linter.set_option('output-format', 'text') assert linter.reporter.__class__.__name__ == 'TextReporter'
def test_report_output_format_aliased(self): text.register(self.linter) self.linter.set_option("output-format", "text") self.assertEqual(self.linter.reporter.__class__.__name__, "TextReporter")