You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
2.2 KiB
Diff
45 lines
2.2 KiB
Diff
Description: use python3 instead of python in tests
|
|
On Debian systems python is still python2, so use python3 explicitely instead
|
|
Author: Philipp Huebner <debalance@debian.org>
|
|
|
|
Index: yamllint/tests/test_module.py
|
|
===================================================================
|
|
--- yamllint.orig/tests/test_module.py
|
|
+++ yamllint/tests/test_module.py
|
|
@@ -46,7 +46,7 @@ class ModuleTestCase(unittest.TestCase):
|
|
|
|
def test_run_module_no_args(self):
|
|
with self.assertRaises(subprocess.CalledProcessError) as ctx:
|
|
- subprocess.check_output(['python', '-m', 'yamllint'],
|
|
+ subprocess.check_output(['python3', '-m', 'yamllint'],
|
|
stderr=subprocess.STDOUT)
|
|
self.assertEqual(ctx.exception.returncode, 2)
|
|
self.assertRegexpMatches(ctx.exception.output.decode(),
|
|
@@ -54,7 +54,7 @@ class ModuleTestCase(unittest.TestCase):
|
|
|
|
def test_run_module_on_bad_dir(self):
|
|
with self.assertRaises(subprocess.CalledProcessError) as ctx:
|
|
- subprocess.check_output(['python', '-m', 'yamllint',
|
|
+ subprocess.check_output(['python3', '-m', 'yamllint',
|
|
'/does/not/exist'],
|
|
stderr=subprocess.STDOUT)
|
|
self.assertRegexpMatches(ctx.exception.output.decode(),
|
|
@@ -62,7 +62,7 @@ class ModuleTestCase(unittest.TestCase):
|
|
|
|
def test_run_module_on_file(self):
|
|
out = subprocess.check_output(
|
|
- ['python', '-m', 'yamllint', os.path.join(self.wd, 'warn.yaml')])
|
|
+ ['python3', '-m', 'yamllint', os.path.join(self.wd, 'warn.yaml')])
|
|
lines = out.decode().splitlines()
|
|
self.assertIn('/warn.yaml', lines[0])
|
|
self.assertEqual('\n'.join(lines[1:]),
|
|
@@ -71,7 +71,7 @@ class ModuleTestCase(unittest.TestCase):
|
|
|
|
def test_run_module_on_dir(self):
|
|
with self.assertRaises(subprocess.CalledProcessError) as ctx:
|
|
- subprocess.check_output(['python', '-m', 'yamllint', self.wd])
|
|
+ subprocess.check_output(['python3', '-m', 'yamllint', self.wd])
|
|
self.assertEqual(ctx.exception.returncode, 1)
|
|
|
|
files = ctx.exception.output.decode().split('\n\n')
|