Skip to content

Commit e2b6601

Browse files
committed
test Matlab code once
1 parent 4bfbd29 commit e2b6601

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

.travis.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ addons:
2525

2626
install: pip -q install -e .[tests]
2727

28-
script: coverage run tests/Test.py -v
28+
script:
29+
- coverage run tests/Test.py -v
30+
- if [[ $TRAVIS_PYTHON_VERSION == 3.7* ]]; then
31+
cd tests;
32+
octave-cli -q Test.m;
33+
cd ..;
34+
fi
2935

3036
after_success:
3137
- if [[ $TRAVIS_PYTHON_VERSION == 3.7* ]]; then coveralls; fi

tests/Test.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function Test()
2-
% Test run a scalarself-test of the PyMap3D Matlab/ Octave functions
2+
% Test run a scalar self-test of the PyMap3D Matlab/ Octave functions
33

44
fpath = fileparts(mfilename('fullpath'));
55
addpath([fpath,filesep,'../matlab']) % comment this line to test Matlab Mapping Toolbox
@@ -65,6 +65,8 @@ function test_transforms(angleUnit,lat,lon,lat1,lon1,az,el)
6565
assert_allclose([e3,n3,u3],[e1,n1,u1])
6666

6767
end % function
68+
69+
disp('test complete')
6870
end
6971

7072

tests/Test.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@
1010
runs tests
1111
"""
1212
import logging
13-
import subprocess
1413
import unittest
1514
from datetime import datetime
1615
try:
17-
import numpy
16+
import numpy, astropy
1817
from numpy import radians
1918
from pymap3d.vincenty import vreckon,vdist
2019
except ImportError:
21-
numpy = None
20+
numpy = astropy = None
2221
from math import radians
2322
from pytz import UTC
2423
#
@@ -50,15 +49,6 @@
5049

5150
class Pure(unittest.TestCase):
5251

53-
def test_bsr(self):
54-
try:
55-
from pathlib import Path
56-
path = Path(__file__).parents[1]
57-
subprocess.check_call(['octave-cli','-q','Test.m'], cwd=path/'tests')
58-
except ImportError:
59-
pass
60-
61-
6252
def test_str2dt(self):
6353

6454
assert str2dt('2014-04-06T08:00:00Z') == datetime(2014,4,6,8, tzinfo=UTC)
@@ -215,7 +205,7 @@ def test_radec2azel(self):
215205

216206

217207
def test_eci(self):
218-
if numpy is None:
208+
if numpy is None or astropy is None:
219209
logging.warning('ECI not tested')
220210
return
221211
tlla = (tlat, tlon, talt)

0 commit comments

Comments
 (0)