summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Röhling <roehling@debian.org>2024-03-01 00:06:52 +0100
committerTimo Röhling <roehling@debian.org>2024-03-01 00:09:29 +0100
commitdd07b2214c02d711db1870d1f28059bc9d8667b0 (patch)
tree54e3222b3ebbdd8cebd4fac0346a113882a9df47
parentb8d2c77bda834cda833a1584fc1d69bebdef08b1 (diff)
Update patches
- Drop Use-Python-3-version-of-pytest.patch (not needed) - New Use-valid-test-module-names.patch Closes: #1063964 Gbp-Dch: full
-rw-r--r--debian/patches/Use-Python-3-version-of-pytest.patch50
-rw-r--r--debian/patches/Use-valid-test-module-names.patch40
-rw-r--r--debian/patches/series2
3 files changed, 41 insertions, 51 deletions
diff --git a/debian/patches/Use-Python-3-version-of-pytest.patch b/debian/patches/Use-Python-3-version-of-pytest.patch
deleted file mode 100644
index 02c6477..0000000
--- a/debian/patches/Use-Python-3-version-of-pytest.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-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')))
diff --git a/debian/patches/Use-valid-test-module-names.patch b/debian/patches/Use-valid-test-module-names.patch
new file mode 100644
index 0000000..d8c6f3c
--- /dev/null
+++ b/debian/patches/Use-valid-test-module-names.patch
@@ -0,0 +1,40 @@
+From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
+Date: Fri, 1 Mar 2024 00:05:18 +0100
+Subject: Use valid test module names
+
+The pytest collector only collects test_*.py and *_test.py files now
+---
+ tests/test_pytest_arraydiff.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tests/test_pytest_arraydiff.py b/tests/test_pytest_arraydiff.py
+index da603fa..9328600 100644
+--- a/tests/test_pytest_arraydiff.py
++++ b/tests/test_pytest_arraydiff.py
+@@ -61,7 +61,7 @@ def test_fails():
+
+ tmpdir = tempfile.mkdtemp()
+
+- test_file = os.path.join(tmpdir, 'test.py')
++ test_file = os.path.join(tmpdir, 'test_fails.py')
+ with open(test_file, 'w') as f:
+ f.write(TEST_FAILING)
+
+@@ -89,7 +89,7 @@ def test_generate(file_format):
+
+ tmpdir = tempfile.mkdtemp()
+
+- test_file = os.path.join(tmpdir, 'test.py')
++ test_file = os.path.join(tmpdir, 'test_generate.py')
+ with open(test_file, 'w') as f:
+ f.write(TEST_GENERATE.format(file_format=file_format))
+
+@@ -123,7 +123,7 @@ def test_default_format(file_format):
+
+ tmpdir = tempfile.mkdtemp()
+
+- test_file = os.path.join(tmpdir, 'test.py')
++ test_file = os.path.join(tmpdir, 'test_default.py')
+ with open(test_file, 'w') as f:
+ f.write(TEST_DEFAULT)
+
diff --git a/debian/patches/series b/debian/patches/series
index b895c23..5029e9f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1 @@
-Use-Python-3-version-of-pytest.patch
+Use-valid-test-module-names.patch