@@ -746,11 +746,9 @@ def test_get_product_exceptions():
746
746
747
747
tap = EuclidClass (tap_plus_conn_handler = conn_handler , datalink_handler = tap_plus , show_server_messages = False )
748
748
749
- with pytest .raises (ValueError ) as exc_info :
749
+ with pytest .raises (ValueError , match = "'file_name' and 'product_id' are both None" ) :
750
750
tap .get_product (file_name = None , product_id = None , output_file = None )
751
751
752
- str (exc_info .value ).startswith ("'file_name' and 'product_id' are both None" )
753
-
754
752
755
753
@patch .object (TapPlus , 'load_data' )
756
754
def test_get_product_exceptions_2 (mock_load_data , caplog ):
@@ -1083,14 +1081,11 @@ def test_get_spectrum_exceptions():
1083
1081
tap .get_spectrum (source_id = '2417660845403252054' , schema = None , output_file = None )
1084
1082
1085
1083
assert str (exc_info .value ).startswith ('Missing required argument' )
1086
-
1087
- with pytest .raises (ValueError ) as exc_info :
1084
+ with pytest .raises (ValueError , match = (
1085
+ "Invalid argument value for 'retrieval_type'. Found hola, expected: 'ALL' or any of \\ ['SPECTRA_BGS', "
1086
+ "'SPECTRA_RGS'\\ ]" )):
1088
1087
tap .get_spectrum (retrieval_type = 'hola' , source_id = '2417660845403252054' , schema = 'schema' , output_file = None )
1089
1088
1090
- assert str (exc_info .value ).startswith (
1091
- "Invalid mandatory argument 'retrieval_type'. Found hola, expected: 'ALL' or any of ['SPECTRA_BGS', "
1092
- "'SPECTRA_RGS']" )
1093
-
1094
1089
1095
1090
@patch .object (TapPlus , 'login' )
1096
1091
def test_login (mock_login ):
0 commit comments