Skip to content

Commit 5f6d94b

Browse files
committed
no need for custom decorator pytest -k does the same thing
1 parent 206c759 commit 5f6d94b

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

astroquery/cadc/tests/test_cadctap_remote.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,13 @@
1818

1919
from pyvo.auth import authsession
2020

21-
22-
# to run just one test during development, set this variable to True
23-
# and comment out the skipif of the single test to run.
24-
one_test = False
25-
2621
# Skip the very slow tests to avoid timeout errors
2722
skip_slow = True
2823

2924

3025
@pytest.mark.remote_data
3126
class TestCadcClass:
3227
# now write tests for each method here
33-
@pytest.mark.skipif(one_test, reason='One test mode')
3428
def test_get_collections(self):
3529
cadc = Cadc()
3630
result = cadc.get_collections()
@@ -50,7 +44,6 @@ def test_get_collections(self):
5044
assert 'Infrared' in result['DAO']['Bands']
5145
assert 'Optical' in result['DAO']['Bands']
5246

53-
@pytest.mark.skipif(one_test, reason='One test mode')
5447
def test_query_region(self):
5548
cadc = Cadc()
5649
result = cadc.query_region('08h45m07.5s +54d18m00s', collection='CFHT')
@@ -76,7 +69,6 @@ def test_query_region(self):
7669
results = cadc.query_region(SkyCoord.from_name('M31'), radius=0.016)
7770
assert len(results) > 20
7871

79-
@pytest.mark.skipif(one_test, reason='One test mode')
8072
def test_query_name(self):
8173
cadc = Cadc()
8274
result1 = cadc.query_name('M31-B14')
@@ -85,7 +77,6 @@ def test_query_name(self):
8577
result2 = cadc.query_name('m31-b14')
8678
assert len(result1) == len(result2)
8779

88-
@pytest.mark.skipif(one_test, reason='One test mode')
8980
def test_query(self):
9081
cadc = Cadc()
9182
result = cadc.exec_sync(
@@ -99,7 +90,6 @@ def test_query(self):
9990
result = cadc.exec_sync(query)
10091
assert len(result) == 0
10192

102-
@pytest.mark.skipif(one_test, reason='One test mode')
10393
@pytest.mark.skip('Disabled for now until pyvo starts supporting '
10494
'different output formats')
10595
def test_query_format(self):
@@ -108,7 +98,6 @@ def test_query_format(self):
10898
result = cadc.exec_sync(query, output_format='csv')
10999
print(result)
110100

111-
@pytest.mark.skipif(one_test, reason='One test mode')
112101
@pytest.mark.skipif(('CADC_USER' not in os.environ
113102
or 'CADC_PASSWD' not in os.environ),
114103
reason='Requires real CADC user/password (CADC_USER '
@@ -142,7 +131,6 @@ def test_login_with_user_password(self):
142131
result = cadc.exec_sync(query)
143132
assert len(result) == 1
144133

145-
@pytest.mark.skipif(one_test, reason='One test mode')
146134
@pytest.mark.skipif('CADC_CERT' not in os.environ,
147135
reason='Requires real CADC certificate (CADC_CERT '
148136
'environment variable)')
@@ -170,7 +158,6 @@ def test_login_with_cert(self):
170158
result = cadc.exec_sync(query)
171159
assert len(result) == 0
172160

173-
@pytest.mark.skipif(one_test, reason='One test mode')
174161
@pytest.mark.skipif('CADC_CERT' not in os.environ,
175162
reason='Requires real CADC certificate (CADC_CERT '
176163
'environment variable)')
@@ -192,7 +179,6 @@ def test_authsession(self):
192179
result = cadc.exec_sync(query)
193180
assert len(result) == 0
194181

195-
@pytest.mark.skipif(one_test, reason='One test mode')
196182
@pytest.mark.xfail(reason='#2325')
197183
def test_get_images(self):
198184
cadc = Cadc()
@@ -204,7 +190,6 @@ def test_get_images(self):
204190
for image in images:
205191
assert isinstance(image, fits.HDUList)
206192

207-
@pytest.mark.skipif(one_test, reason='One test mode')
208193
@pytest.mark.skipif(skip_slow, reason='Avoid timeout errors')
209194
def test_get_images_against_AS(self):
210195
cadc = Cadc()
@@ -238,7 +223,6 @@ def test_get_images_against_AS(self):
238223

239224
assert len(filtered_resp_urls) == len(image_urls)
240225

241-
@pytest.mark.skipif(one_test, reason='One test mode')
242226
@pytest.mark.xfail(reason='#2325')
243227
def test_get_images_async(self):
244228
cadc = Cadc()
@@ -249,7 +233,6 @@ def test_get_images_async(self):
249233
for obj in readable_objs:
250234
assert isinstance(obj, FileContainer)
251235

252-
@pytest.mark.skipif(one_test, reason='One test mode')
253236
def test_async(self):
254237
# test async calls
255238
cadc = Cadc()
@@ -277,7 +260,6 @@ def test_async(self):
277260
assert expected['observationID'][ii] == result['observationID'][ii]
278261
# job.delete() # BUG in CADC
279262

280-
@pytest.mark.skipif(one_test, reason='One test mode')
281263
def test_list_tables(self):
282264
cadc = Cadc()
283265
table_names = cadc.get_tables(only_names=True)
@@ -293,7 +275,6 @@ def test_list_tables(self):
293275
table = cadc.get_table('caom2.Observation')
294276
assert 'caom2.Observation' == table.name
295277

296-
@pytest.mark.skipif(one_test, reason='One test mode')
297278
@pytest.mark.skipif('CADC_CERT' not in os.environ,
298279
reason='Requires real CADC certificate (CADC_CERT '
299280
'environment variable)')

0 commit comments

Comments
 (0)