tests: Replace deprecated aliases

https://docs.python.org/3/library/unittest.html#deprecated-aliases
This commit is contained in:
Mathieu Couette
2020-09-29 12:11:09 -04:00
committed by Adrien Vergé
parent 8eebab68ab
commit 9ee8c27ac9
3 changed files with 13 additions and 13 deletions

View File

@@ -47,7 +47,7 @@ class ModuleTestCase(unittest.TestCase):
subprocess.check_output([PYTHON, '-m', 'yamllint'],
stderr=subprocess.STDOUT)
self.assertEqual(ctx.exception.returncode, 2)
self.assertRegexpMatches(ctx.exception.output.decode(),
self.assertRegex(ctx.exception.output.decode(),
r'^usage: yamllint')
def test_run_module_on_bad_dir(self):
@@ -55,7 +55,7 @@ class ModuleTestCase(unittest.TestCase):
subprocess.check_output([PYTHON, '-m', 'yamllint',
'/does/not/exist'],
stderr=subprocess.STDOUT)
self.assertRegexpMatches(ctx.exception.output.decode(),
self.assertRegex(ctx.exception.output.decode(),
r'No such file or directory')
def test_run_module_on_file(self):