Skip to content

Commit edb5d62

Browse files
committed
pytest minversion
1 parent 76235fe commit edb5d62

File tree

4 files changed

+7
-16
lines changed

4 files changed

+7
-16
lines changed

.travis.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@ install:
2020
script:
2121
- pytest -rsv
2222

23-
- if [[ $TRAVIS_PYTHON_VERSION == 3.6* ]]; then
24-
flake8;
25-
mypy . --ignore-missing-imports;
26-
fi
23+
- if [[ $TRAVIS_PYTHON_VERSION == 3.6* ]]; then flake8; fi
24+
- if [[ $TRAVIS_PYTHON_VERSION == 3.6* ]]; then mypy . --ignore-missing-imports; fi
2725

2826
after_success:
2927
- if [[ $TRAVIS_PYTHON_VERSION == 3.6* ]]; then

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ install_requires =
3838
[options.extras_require]
3939
tests =
4040
pytest
41-
packaging
4241
cov =
4342
pytest-cov
4443
coveralls

tests/test_main.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,10 @@
1010
import numpy as np
1111
import pymap3d as pm
1212
from pymap3d.timeconv import str2dt
13-
from packaging import version
1413

1514
pi = np.pi
1615
nan = np.nan
1716

18-
OLD = version.parse(pytest.__version__) < version.parse('3.5')
19-
2017
lla0 = (42, -82, 200)
2118
rlla0 = (np.radians(lla0[0]), np.radians(lla0[1]), lla0[2])
2219

@@ -57,12 +54,11 @@ def test_str2dt():
5754
to = [datetime(2014, 4, 6, 8), datetime(2014, 4, 6, 8, 1, 2)]
5855
assert ti == to # even though ti is numpy array of datetime and to is list of datetime
5956

60-
# %%
61-
6257

63-
@pytest.mark.skipif(OLD, reason='too old pytest')
6458
def test_losint():
6559

60+
pytest.importorskip('pytest', minversion='3.5')
61+
6662
az = [0., 10., 125.]
6763

6864
lat, lon, sr = pm.lookAtSpheroid(*lla0, az, tilt=0.)

tests/test_vincenty.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
from pytest import approx
44
from pymap3d.vincenty import vreckon, vdist, track2
55
import numpy as np
6-
from packaging import version
7-
8-
OLD = version.parse(pytest.__version__) < version.parse('3.5')
96

107
az = [38., 45.]
118
sr = [3e3, 1e3]
@@ -31,9 +28,9 @@ def test_track2():
3128
assert lons == approx([80, 113.06849104, -148])
3229

3330

34-
@pytest.mark.skipif(OLD, reason='too old pytest')
3531
def test_vreckon():
3632
""" tests scalars, vectors"""
33+
pytest.importorskip('pytest', minversion='3.5')
3734

3835
# scalar
3936
assert vreckon(*ll0, sr[0], az[0]) == approx((lat2[0], lon2[0], az2[0]))
@@ -49,8 +46,9 @@ def test_vreckon():
4946
assert c == approx(az3)
5047

5148

52-
@pytest.mark.skipif(OLD, reason='too old pytest')
5349
def test_vdist():
50+
pytest.importorskip('pytest', minversion='3.5')
51+
5452
lat1, lon1, a21 = vreckon(*ll0, sr[0], az[0])
5553

5654
assert vdist(*ll0, lat1, lon1) == approx((sr[0], az[0], a21))

0 commit comments

Comments
 (0)