summaryrefslogtreecommitdiff
path: root/debian/patches/Use-Python-3-version-of-pytest.patch
blob: 02c64779413dba4d07a13af15be1cfe5f9227434 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From: Ole Streicher <olebole@debian.org>
Date: Sun, 14 Jan 2018 16:12:57 +0100
Subject: Use Python 3 version of pytest

---
 tests/test_pytest_arraydiff.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/test_pytest_arraydiff.py b/tests/test_pytest_arraydiff.py
index da603fa..7c903ac 100644
--- a/tests/test_pytest_arraydiff.py
+++ b/tests/test_pytest_arraydiff.py
@@ -66,11 +66,11 @@ def test_fails():
         f.write(TEST_FAILING)
 
     # If we use --arraydiff, it should detect that the file is missing
-    code = subprocess.call('pytest --arraydiff {0}'.format(test_file), shell=True)
+    code = subprocess.call('pytest-3 --arraydiff {0}'.format(test_file), shell=True)
     assert code != 0
 
     # If we don't use --arraydiff option, the test should succeed
-    code = subprocess.call('pytest {0}'.format(test_file), shell=True)
+    code = subprocess.call('pytest-3 {0}'.format(test_file), shell=True)
     assert code == 0
 
 
@@ -97,12 +97,12 @@ def test_generate(file_format):
 
     # If we don't generate, the test will fail
     try:
-        subprocess.check_output(['pytest', '--arraydiff', test_file], timeout=10)
+        subprocess.check_output(['pytest-3', '--arraydiff', test_file], timeout=10)
     except subprocess.CalledProcessError as grepexc:
         assert b'File not found for comparison test' in grepexc.output
 
     # If we do generate, the test should succeed and a new file will appear
-    code = subprocess.call(['pytest', '--arraydiff-generate-path={0}'.format(gen_dir), test_file],
+    code = subprocess.call(['pytest-3', '--arraydiff-generate-path={0}'.format(gen_dir), test_file],
                            timeout=10)
     assert code == 0
     assert os.path.exists(os.path.join(gen_dir, 'test_gen.' + ('fits' if file_format == 'fits' else 'txt')))
@@ -130,7 +130,7 @@ def test_default_format(file_format):
     gen_dir = os.path.join(tmpdir, 'spam', 'egg')
 
     # If we do generate, the test should succeed and a new file will appear
-    code = subprocess.call('pytest -s --arraydiff-default-format={0}'
+    code = subprocess.call('pytest-3 -s --arraydiff-default-format={0}'
                            ' --arraydiff-generate-path={1} {2}'.format(file_format, gen_dir, test_file), shell=True)
     assert code == 0
     assert os.path.exists(os.path.join(gen_dir, 'test_default.' + ('fits' if file_format == 'fits' else 'txt')))