(esasky) Prefer pytest-style tests -- Refs
@@ -4,7 +4,6 @@ from __future__ import print_function
import pytest
import os
-import unittest
from ...utils.testing_tools import MockResponse
from ...esasky import ESASky
@@ -40,19 +39,21 @@ def esasky_request(request):
return mp
-class TestEsaSkyLocal(unittest.TestCase):
- def test_esasky_query_region_maps_invalid_position(self):
- with self.assertRaises(ValueError):
+def test_esasky_query_region_maps_invalid_position():
+ with pytest.raises(ValueError):
ESASky.query_region_maps(51, "5 arcmin")
- def test_esasky_query_region_maps_invalid_radius(self):
- with self.assertRaises(ValueError):
+
+def test_esasky_query_region_maps_invalid_radius():
+ with pytest.raises(ValueError):
ESASky.query_region_maps("M51", 5)
- def test_esasky_query_region_maps_invalid_mission(self):
- with self.assertRaises(ValueError):
+
+def test_esasky_query_region_maps_invalid_mission():
+ with pytest.raises(ValueError):
ESASky.query_region_maps("M51", "5 arcmin", missions=True)
- def test_list_catalogs(self):
+
+def test_list_catalogs():
result = ESASky.list_catalogs()
- assert (len(result) == 13)
+ assert len(result) == 13
