diff options
author | Frank Harrison <doublethefish@gmail.com> | 2020-04-03 13:47:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-03 14:47:10 +0200 |
commit | 5f1353a57394a422bf5a817b93d0137fa588cf1b (patch) | |
tree | 4db30f5abd5f0f469d110f9b2bc29dea9b404b75 /tests/test_pylint_runners.py | |
parent | c1a48e9ec3082664780f30bdb6b7fa7d021fec25 (diff) | |
download | pylint-git-5f1353a57394a422bf5a817b93d0137fa588cf1b.tar.gz |
Invoke the runners under exit-0 conditions in tests
This is designed to simply ensure that the runners exist and haven't
been broken or changed in unexpected ways by refactors.
Whilst linting may catch changes, having a test that ensures the current
behaviour is captured ensures any changes are more likely to be intentional.
Diffstat (limited to 'tests/test_pylint_runners.py')
-rw-r--r-- | tests/test_pylint_runners.py | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/test_pylint_runners.py b/tests/test_pylint_runners.py new file mode 100644 index 000000000..7b92ddcba --- /dev/null +++ b/tests/test_pylint_runners.py @@ -0,0 +1,47 @@ +""" Here we test the executable iterfaces shipped with pylint """ +import os +import sys +import unittest +from unittest.mock import patch + +from pylint import run_pylint, run_epylint, run_pyreverse, run_symilar + + +class TestRunners(unittest.TestCase): + """ A tester to ensure that the runners we ship execute with minimal params """ + + def test_run_pylint(self): + """ Tests basic invocation of the pylint setup via the runner func """ + filepath = os.path.abspath(__file__) + testargs = ["", filepath] + with patch.object(sys, "argv", testargs): + with self.assertRaises(SystemExit) as err: + run_pylint() + self.assertEqual(0, err.exception.code) + + def test_run_epylint(self): + """ Tests basic invocation of the epylint setup via its runner func """ + filepath = os.path.abspath(__file__) + testargs = ["", filepath] + with patch.object(sys, "argv", testargs): + with self.assertRaises(SystemExit) as err: + run_epylint() + self.assertEqual(0, err.exception.code) + + def test_run_pyreverse(self): + """ Tests basic invocation of pyreverse """ + filepath = os.path.abspath(__file__) + testargs = ["", filepath] + with patch.object(sys, "argv", testargs): + with self.assertRaises(SystemExit) as err: + run_pyreverse() + self.assertEqual(0, err.exception.code) + + def test_run_symilar(self): + """ Tests basic invocation of the similar utilities via its runner func """ + filepath = os.path.abspath(__file__) + testargs = ["", filepath] + with patch.object(sys, "argv", testargs): + with self.assertRaises(SystemExit) as err: + run_symilar() + self.assertEqual(0, err.exception.code) |