Skip to content

Commit d40d316

Browse files
authored
Merge pull request #2383 from bsipocz/tests_remove_unittest_gaia_dace
Tests remove unittest from gaia and dace
2 parents 6ac4fb4 + 6ec71ce commit d40d316

File tree

2 files changed

+15
-27
lines changed

2 files changed

+15
-27
lines changed

astroquery/dace/tests/test_dace.py

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import unittest
32
import json
43
from astroquery.dace import Dace
54

@@ -8,24 +7,19 @@
87
}
98

109

11-
class TestDaceClass(unittest.TestCase):
12-
def test_transform_data_as_dict(self):
13-
expected_parameter_dict = {'ccf_noise': [0.005320016177906, 0.00393390440796704, 0.0032324617496158],
14-
'ins_name': ['CORALIE98', 'CORALIE98', 'HARPS'],
15-
'drs_qc': [True, True, False],
16-
'rjd': [51031, 51039, 51088],
17-
'rv': [31300.4226771379, 31295.5671320506, 31294.3391634734],
18-
'rv_err': [5.420218247708816, 4.0697289792344185, 3.4386352834851026]}
19-
with open(self._data_path('parameter_list.json'), 'r') as file:
20-
parameter_list = json.load(file)
21-
parameter_dict = Dace.transform_data_as_dict(parameter_list)
22-
assert parameter_dict == expected_parameter_dict
10+
def test_transform_data_as_dict():
11+
expected_parameter_dict = {'ccf_noise': [0.005320016177906, 0.00393390440796704, 0.0032324617496158],
12+
'ins_name': ['CORALIE98', 'CORALIE98', 'HARPS'],
13+
'drs_qc': [True, True, False],
14+
'rjd': [51031, 51039, 51088],
15+
'rv': [31300.4226771379, 31295.5671320506, 31294.3391634734],
16+
'rv_err': [5.420218247708816, 4.0697289792344185, 3.4386352834851026]}
17+
with open(_data_path('parameter_list.json'), 'r') as file:
18+
parameter_list = json.load(file)
19+
parameter_dict = Dace.transform_data_as_dict(parameter_list)
20+
assert parameter_dict == expected_parameter_dict
2321

24-
@staticmethod
25-
def _data_path(filename):
26-
data_dir = os.path.join(os.path.dirname(__file__), 'data')
27-
return os.path.join(data_dir, filename)
2822

29-
30-
if __name__ == "__main__":
31-
unittest.main()
23+
def _data_path(filename):
24+
data_dir = os.path.join(os.path.dirname(__file__), 'data')
25+
return os.path.join(data_dir, filename)

astroquery/gaia/tests/test_gaiatap.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
1515
1616
"""
17-
import unittest
1817
import os
1918
from unittest.mock import patch
2019

@@ -40,7 +39,7 @@ def data_path(filename):
4039
return os.path.join(data_dir, filename)
4140

4241

43-
class TestTap(unittest.TestCase):
42+
class TestTap():
4443

4544
def test_query_object(self):
4645
conn_handler = DummyConnHandler()
@@ -609,8 +608,3 @@ def test_logout(self, mock_logout):
609608
mock_logout.side_effect = HTTPError("Login error")
610609
tap.logout()
611610
assert (mock_logout.call_count == 3)
612-
613-
614-
if __name__ == "__main__":
615-
# import sys;sys.argv = ['', 'Test.testName']
616-
unittest.main()

0 commit comments

Comments
 (0)