Skip to content

Commit 49562e5

Browse files
committed
fixing deploy workflow 5
1 parent f55b56d commit 49562e5

File tree

6 files changed

+38
-25
lines changed

6 files changed

+38
-25
lines changed

.github/workflows/deploy.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@ jobs:
3838
run: |
3939
conda info
4040
conda config --add channels conda-forge
41-
conda install obspy pandas
41+
conda install obspy pandas pytest
4242
pip install stdb
4343
pip install geographiclib
4444
pip install -e .
45+
conda list
4546
4647
- name: Tests
4748
shell: bash -l {0}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

orientpy/tests/test_1_args.py

+36-24
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
def test_dl_calc_args():
1111
from orientpy.scripts import dl_calc as dl
1212
# no stdb
13-
with pytest.raises(SystemExit):
14-
assert dl.get_dl_calc_arguments()
13+
with pytest.raises(SystemExit) as excinfo:
14+
dl.get_dl_calc_arguments()
15+
assert excinfo.value.code == 1
1516

1617
# defaults
1718
args0 = dl.get_dl_calc_arguments([dbfile])
@@ -21,21 +22,24 @@ def test_dl_calc_args():
2122
# start time
2223
args = dl.get_dl_calc_arguments(
2324
[dbfile, '--start', '2014-10-01'])
24-
with pytest.raises(SystemExit):
25-
assert dl.get_dl_calc_arguments([
25+
with pytest.raises(SystemExit) as excinfo:
26+
dl.get_dl_calc_arguments([
2627
dbfile, '--start', 'abcd'])
28+
assert excinfo.value.code == 1
2729
# end time
2830
args = dl.get_dl_calc_arguments([
2931
dbfile, '--end', '2015-01-01'])
30-
with pytest.raises(SystemExit):
31-
assert dl.get_dl_calc_arguments([
32+
with pytest.raises(SystemExit) as excinfo:
33+
dl.get_dl_calc_arguments([
3234
dbfile, '--end', 'abcd'])
35+
assert excinfo.value.code == 1
3336
# user auth.
3437
args = dl.get_dl_calc_arguments([
3538
dbfile, '-U', 'bla:bla'])
36-
with pytest.raises(SystemExit):
37-
assert dl.get_dl_calc_arguments([
39+
with pytest.raises(SystemExit) as excinfo:
40+
dl.get_dl_calc_arguments([
3841
dbfile, '-U', 'abcd'])
42+
assert excinfo.value.code == 1
3943
# local data
4044
args = dl.get_dl_calc_arguments([
4145
dbfile, '--local-data', 'bla'])
@@ -48,8 +52,9 @@ def test_dl_calc_args():
4852
def test_dl_average_args():
4953
from orientpy.scripts import dl_average as dl
5054
# no stdb
51-
with pytest.raises(SystemExit):
52-
assert dl.get_dl_average_arguments()
55+
with pytest.raises(SystemExit) as excinfo:
56+
dl.get_dl_average_arguments()
57+
assert excinfo.value.code == 1
5358
# defaults
5459
args0 = dl.get_dl_average_arguments([dbfile])
5560
# keys
@@ -61,8 +66,9 @@ def test_dl_average_args():
6166
def test_bng_calc_args():
6267
from orientpy.scripts import bng_calc_auto as bng
6368
# no stdb
64-
with pytest.raises(SystemExit):
65-
assert bng.get_bng_calc_arguments()
69+
with pytest.raises(SystemExit) as excinfo:
70+
bng.get_bng_calc_arguments()
71+
assert excinfo.value.code == 1
6672
# default
6773
args0 = bng.get_bng_calc_arguments([dbfile])
6874
# keys
@@ -71,21 +77,24 @@ def test_bng_calc_args():
7177
# start time
7278
args = bng.get_bng_calc_arguments(
7379
[dbfile, '--start', '2014-10-01'])
74-
with pytest.raises(SystemExit):
75-
assert bng.get_bng_calc_arguments([
80+
with pytest.raises(SystemExit) as excinfo:
81+
bng.get_bng_calc_arguments([
7682
dbfile, '--start', 'abcd'])
83+
assert excinfo.value.code == 1
7784
# end time
7885
args = bng.get_bng_calc_arguments([
7986
dbfile, '--end', '2015-01-01'])
80-
with pytest.raises(SystemExit):
81-
assert bng.get_bng_calc_arguments([
87+
with pytest.raises(SystemExit) as excinfo:
88+
bng.get_bng_calc_arguments([
8289
dbfile, '--end', 'abcd'])
90+
assert excinfo.value.code == 1
8391
# user auth.
8492
args = bng.get_bng_calc_arguments([
8593
dbfile, '-U', 'bla:bla'])
86-
with pytest.raises(SystemExit):
87-
assert bng.get_bng_calc_arguments([
94+
with pytest.raises(SystemExit) as excinfo:
95+
bng.get_bng_calc_arguments([
8896
dbfile, '-U', 'abcd'])
97+
assert excinfo.value.code == 1
8998
# local data
9099
args = bng.get_bng_calc_arguments([
91100
dbfile, '--local-data', 'bla'])
@@ -95,23 +104,26 @@ def test_bng_calc_args():
95104
# bp
96105
args = bng.get_bng_calc_arguments([
97106
dbfile, '--bp', '1.,2.'])
98-
with pytest.raises(SystemExit):
99-
assert bng.get_bng_calc_arguments([
107+
with pytest.raises(SystemExit) as excinfo:
108+
bng.get_bng_calc_arguments([
100109
dbfile, '--bp', '1.'])
110+
assert excinfo.value.code == 1
101111
# tt
102112
args = bng.get_bng_calc_arguments([
103113
dbfile, '--times', '1.,2.'])
104-
with pytest.raises(SystemExit):
105-
assert bng.get_bng_calc_arguments([
114+
with pytest.raises(SystemExit) as excinfo:
115+
bng.get_bng_calc_arguments([
106116
dbfile, '--times', '1.'])
117+
assert excinfo.value.code == 1
107118

108119
return args0
109120

110121
def test_bng_average_args():
111122
from orientpy.scripts import bng_average as bng
112123
# no stdb
113-
with pytest.raises(SystemExit):
114-
assert bng.get_bng_average_arguments()
124+
with pytest.raises(SystemExit) as excinfo:
125+
bng.get_bng_average_arguments()
126+
assert excinfo.value.code == 1
115127
# defaults
116128
args0 = bng.get_bng_average_arguments([dbfile])
117129
# keys

0 commit comments

Comments
 (0)