コード例 #1
0
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")
コード例 #2
0
def test_set_unsupported_reporter(linter):
    text.register(linter)
    with pytest.raises(exceptions.InvalidReporterError):
        linter.set_option("output-format", "missing.module.Class")
コード例 #3
0
def test_report_output_format_aliased(linter):
    text.register(linter)
    linter.set_option("output-format", "text")
    assert linter.reporter.__class__.__name__ == "TextReporter"
コード例 #4
0
ファイル: unittest_lint.py プロジェクト: yannack/pylint
 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')
コード例 #5
0
ファイル: unittest_lint.py プロジェクト: Mariatta/pylint
def test_set_unsupported_reporter(linter):
    text.register(linter)
    with pytest.raises(exceptions.InvalidReporterError):
        linter.set_option('output-format', 'missing.module.Class')
コード例 #6
0
ファイル: unittest_lint.py プロジェクト: Mariatta/pylint
def test_report_output_format_aliased(linter):
    text.register(linter)
    linter.set_option('output-format', 'text')
    assert linter.reporter.__class__.__name__ == 'TextReporter'
コード例 #7
0
def test_report_output_format_aliased(linter):
    text.register(linter)
    linter.set_option('output-format', 'text')
    assert linter.reporter.__class__.__name__ == 'TextReporter'
コード例 #8
0
def test_report_output_format_aliased(linter):
    text.register(linter)
    linter.set_option("output-format", "text")
    assert linter.reporter.__class__.__name__ == "TextReporter"
コード例 #9
0
ファイル: unittest_lint.py プロジェクト: si618/pi-time
 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")