@@ -233,31 +233,17 @@ def test_diffraction_objects_equality(inputs1, inputs2, expected):
233
233
234
234
235
235
def test_dump (tmp_path , mocker ):
236
- x , y = np .linspace (0 , 10 , 11 ), np .linspace (0 , 10 , 11 )
236
+ x , y = np .linspace (0 , 5 , 6 ), np .linspace (0 , 5 , 6 )
237
237
directory = Path (tmp_path )
238
238
file = directory / "testfile"
239
239
test = Diffraction_object ()
240
240
test .wavelength = 1.54
241
241
test .name = "test"
242
242
test .scat_quantity = "x-ray"
243
-
244
- with warnings .catch_warnings (record = True ) as captured_warnings :
245
- # Configure the warnings system to capture all warnings
246
- warnings .simplefilter ("always" )
247
-
248
- # Perform the method call that is expected to trigger the RuntimeWarning due to the specified wavelength
249
- test .insert_scattering_quantity (
243
+ test .insert_scattering_quantity (
250
244
x , y , "q" , metadata = {"thing1" : 1 , "thing2" : "thing2" , "package_info" : {"package2" : "3.4.5" }}
251
- )
252
-
253
- # Verify that at least one RuntimeWarning is raised due to the arcsin error from wavelength 1.54
254
- assert any (
255
- isinstance (w .message , RuntimeWarning ) for w in captured_warnings
256
- ), "Expected a RuntimeWarning due to invalid arcsin input value from the wavelength set to 1.54"
257
-
258
- # Ensure that exactly one warning was captured
259
- assert len (captured_warnings ) == 1 , "Expected exactly one warning to be captured"
260
-
245
+ )
246
+
261
247
mocker .patch ("importlib.metadata.version" , return_value = "3.3.0" )
262
248
263
249
with freeze_time ("2012-01-14" ):
@@ -275,11 +261,6 @@ def test_dump(tmp_path, mocker):
275
261
"3.000000000000000000e+00 3.000000000000000000e+00\n "
276
262
"4.000000000000000000e+00 4.000000000000000000e+00\n "
277
263
"5.000000000000000000e+00 5.000000000000000000e+00\n "
278
- "6.000000000000000000e+00 6.000000000000000000e+00\n "
279
- "7.000000000000000000e+00 7.000000000000000000e+00\n "
280
- "8.000000000000000000e+00 8.000000000000000000e+00\n "
281
- "9.000000000000000000e+00 9.000000000000000000e+00\n "
282
- "1.000000000000000000e+01 1.000000000000000000e+01\n "
283
264
)
284
265
285
266
assert actual == expected
0 commit comments