Skip to content

Commit 3f7fda6

Browse files
committed
TST: Remove old code
Bump Python, update matrix, fix Release
1 parent a36803e commit 3f7fda6

File tree

5 files changed

+29
-35
lines changed

5 files changed

+29
-35
lines changed

.github/workflows/ci_workflows.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,30 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
include:
17-
- os: ubuntu-latest
18-
python-version: 3.6
19-
toxenv: py36-test-pytest46
20-
- os: windows-latest
21-
python-version: 3.6
22-
toxenv: py36-test-pytest50
23-
- os: macos-latest
24-
python-version: 3.7
25-
toxenv: py37-test-pytest51
2617
- os: ubuntu-latest
2718
python-version: 3.7
28-
toxenv: py37-test-pytest52
19+
toxenv: py37-test-pytest46
2920
- os: windows-latest
21+
python-version: 3.7
22+
toxenv: py37-test-pytest50
23+
- os: macos-latest
3024
python-version: 3.8
31-
toxenv: py38-test-pytest53
25+
toxenv: py38-test-pytest52
3226
- os: ubuntu-latest
3327
python-version: 3.8
34-
toxenv: py38-test-pytest60
28+
toxenv: py38-test-pytest53
29+
- os: windows-latest
30+
python-version: 3.9
31+
toxenv: py39-test-pytest60
3532
- os: macos-latest
3633
python-version: 3.9
3734
toxenv: py39-test-pytest61
3835
- os: ubuntu-latest
39-
python-version: 3.9
40-
toxenv: py39-test-pytestdev
36+
python-version: '3.10'
37+
toxenv: py310-test-pytest62
38+
- os: ubuntu-latest
39+
python-version: '3.10'
40+
toxenv: py310-test-pytestdev
4141

4242
steps:
4343
- uses: actions/checkout@v2
@@ -47,7 +47,7 @@ jobs:
4747
uses: actions/setup-python@v2
4848
with:
4949
python-version: ${{ matrix.python-version }}
50-
- name: Install Tox
50+
- name: Install tox
5151
run: python -m pip install tox
52-
- name: Run Tox
52+
- name: Run tox
5353
run: tox -v -e ${{ matrix.toxenv }}

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
0.4 (unreleased)
22
----------------
33

4+
- Minimum Python version is now 3.7. [#30]
5+
46
- Various infrastructure updates.
57

68
0.3 (2018-12-05)

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ long_description_content_type = text/x-rst
2626
[options]
2727
zip_safe = False
2828
packages = find:
29-
python_requires = >=3.6
29+
python_requires = >=3.7
3030
setup_requires =
3131
setuptools_scm
3232
install_requires =

tests/test_pytest_arraydiff.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import os
2-
import sys
32
import subprocess
43
import tempfile
54

65
import pytest
76
import numpy as np
87

9-
PY2 = sys.version_info[0] == 2
10-
118
reference_dir = 'baseline'
129

1310

@@ -58,11 +55,11 @@ def test_fails():
5855
f.write(TEST_FAILING)
5956

6057
# If we use --arraydiff, it should detect that the file is missing
61-
code = subprocess.call('py.test --arraydiff {0}'.format(test_file), shell=True)
58+
code = subprocess.call('pytest --arraydiff {0}'.format(test_file), shell=True)
6259
assert code != 0
6360

6461
# If we don't use --arraydiff option, the test should succeed
65-
code = subprocess.call('py.test {0}'.format(test_file), shell=True)
62+
code = subprocess.call('pytest {0}'.format(test_file), shell=True)
6663
assert code == 0
6764

6865

@@ -89,19 +86,13 @@ def test_generate(file_format):
8986

9087
# If we don't generate, the test will fail
9188
try:
92-
if PY2:
93-
subprocess.check_output(['pytest', '--arraydiff', test_file])
94-
else:
95-
subprocess.check_output(['pytest', '--arraydiff', test_file], timeout=10)
89+
subprocess.check_output(['pytest', '--arraydiff', test_file], timeout=10)
9690
except subprocess.CalledProcessError as grepexc:
9791
assert b'File not found for comparison test' in grepexc.output
9892

9993
# If we do generate, the test should succeed and a new file will appear
100-
if PY2:
101-
code = subprocess.call(['pytest', '--arraydiff-generate-path={0}'.format(gen_dir), test_file])
102-
else:
103-
code = subprocess.call(['pytest', '--arraydiff-generate-path={0}'.format(gen_dir), test_file],
104-
timeout=10)
94+
code = subprocess.call(['pytest', '--arraydiff-generate-path={0}'.format(gen_dir), test_file],
95+
timeout=10)
10596
assert code == 0
10697
assert os.path.exists(os.path.join(gen_dir, 'test_gen.' + ('fits' if file_format == 'fits' else 'txt')))
10798

@@ -115,6 +106,7 @@ def test_default():
115106
return np.arange(6 * 5).reshape((6, 5))
116107
"""
117108

109+
118110
@pytest.mark.parametrize('file_format', ('fits', 'text'))
119111
def test_default_format(file_format):
120112

@@ -127,15 +119,15 @@ def test_default_format(file_format):
127119
gen_dir = os.path.join(tmpdir, 'spam', 'egg')
128120

129121
# If we do generate, the test should succeed and a new file will appear
130-
code = subprocess.call('py.test -s --arraydiff-default-format={0}'
122+
code = subprocess.call('pytest -s --arraydiff-default-format={0}'
131123
' --arraydiff-generate-path={1} {2}'.format(file_format, gen_dir, test_file), shell=True)
132124
assert code == 0
133125
assert os.path.exists(os.path.join(gen_dir, 'test_default.' + ('fits' if file_format == 'fits' else 'txt')))
134126

135127

136128
@pytest.mark.array_compare(reference_dir=reference_dir, rtol=0.5, file_format='fits')
137129
def test_tolerance():
138-
return np.ones((3,4)) * 1.6
130+
return np.ones((3, 4)) * 1.6
139131

140132

141133
def test_nofile():

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
envlist =
3-
py{36,37,38,39}-test{,-devdeps}
3+
py{37,38,39,310}-test{,-devdeps}
44
codestyle
55
requires =
66
setuptools >= 30.3.0
@@ -13,11 +13,11 @@ description = run tests
1313
deps =
1414
pytest46: pytest==4.6.*
1515
pytest50: pytest==5.0.*
16-
pytest51: pytest==5.1.*
1716
pytest52: pytest==5.2.*
1817
pytest53: pytest==5.3.*
1918
pytest60: pytest==6.0.*
2019
pytest61: pytest==6.1.*
20+
pytest62: pytest==6.2.*
2121
pytestdev: git+https://github.com/pytest-dev/pytest#egg=pytest
2222

2323
commands =

0 commit comments

Comments
 (0)