Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion aquerytest/aquerytest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from astroquery.simbad import Simbad
import time

__all__ = ['AQueryTest']

Expand All @@ -8,16 +8,27 @@ def __init__(self):
pass

def run(self):
from astroquery.simbad import Simbad

Simbad.add_votable_fields('flux(U)', 'flux(B)', 'flux(V)', 'flux(R)', 'flux(I)', 'flux(J)', 'sptype',
'parallax', 'pm', 'z_value')
print('Running first query...')
table = Simbad.query_object('3C273')
print(table)

if table is None:
raise RuntimeError("Could not query.")

sleep = 600
print(f'Sleeping for {sleep}s...')
time.sleep(sleep)
table = Simbad.query_object('3C273')
print('Success after a long sleep!')

return table

def run_fail(self):
from astroquery.simbad import Simbad
Simbad.add_votable_fields('flux(U)', 'flux(B)', 'flux(V)', 'flux(R)', 'flux(I)', 'flux(J)', 'sptype',
'parallax', 'pm', 'z_value')
table = Simbad.query_object('BLAH')
Expand Down
5 changes: 1 addition & 4 deletions tests/test_aquerytest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import aquerytest
import pytest
import time


def test_aquerytest():
Expand All @@ -12,7 +11,5 @@ def test_aquerytest():
with pytest.raises(RuntimeError):
_ = tester.run_fail()

time.sleep(600)

table = tester.run()
print(table)
assert table is not None