@@ -232,7 +232,7 @@ def test_diffraction_objects_equality(inputs1, inputs2, expected):
232232
233233
234234def test_dump (tmp_path , mocker ):
235- x , y = np .linspace (0 , 10 , 11 ), np .linspace (0 , 10 , 11 )
235+ x , y = np .linspace (0 , 5 , 6 ), np .linspace (0 , 5 , 6 )
236236 directory = Path (tmp_path )
237237 file = directory / "testfile"
238238 test = Diffraction_object ()
@@ -242,8 +242,12 @@ def test_dump(tmp_path, mocker):
242242 test .insert_scattering_quantity (
243243 x , y , "q" , metadata = {"thing1" : 1 , "thing2" : "thing2" , "package_info" : {"package2" : "3.4.5" }}
244244 )
245- with mocker .patch ("importlib.metadata.version" , return_value = "3.3.0" ), freeze_time ("2012-01-14" ):
245+
246+ mocker .patch ("importlib.metadata.version" , return_value = "3.3.0" )
247+
248+ with freeze_time ("2012-01-14" ):
246249 test .dump (file , "q" )
250+
247251 with open (file , "r" ) as f :
248252 actual = f .read ()
249253 expected = (
@@ -256,10 +260,6 @@ def test_dump(tmp_path, mocker):
256260 "3.000000000000000000e+00 3.000000000000000000e+00\n "
257261 "4.000000000000000000e+00 4.000000000000000000e+00\n "
258262 "5.000000000000000000e+00 5.000000000000000000e+00\n "
259- "6.000000000000000000e+00 6.000000000000000000e+00\n "
260- "7.000000000000000000e+00 7.000000000000000000e+00\n "
261- "8.000000000000000000e+00 8.000000000000000000e+00\n "
262- "9.000000000000000000e+00 9.000000000000000000e+00\n "
263- "1.000000000000000000e+01 1.000000000000000000e+01\n "
264263 )
264+
265265 assert actual == expected
0 commit comments