@@ -346,15 +346,22 @@ def test_numpy_tolerance_args(self):
346
346
"""
347
347
quick check that numpy rel/abs args are handled correctly
348
348
for comparison against an np.array
349
+ - 3.6.4 would approx both actual / expected if np.array
350
+ regardless of which value was passed to approx()
351
+ Means tolerance could be calculated against bad test return
349
352
"""
350
353
np = pytest .importorskip ("numpy" )
351
354
expected = 100
352
355
actual = 99
353
356
assert actual != pytest .approx (expected , abs = 0.1 , rel = 0 )
354
357
assert np .array (actual ) != pytest .approx (expected , abs = 0.1 , rel = 0 )
358
+ assert actual != pytest .approx (np .array (expected ), abs = 0.1 , rel = 0 )
359
+ assert np .array (actual ) != pytest .approx (np .array (expected ), abs = 0.1 , rel = 0 )
355
360
356
361
assert actual == pytest .approx (expected , abs = 0 , rel = 0.01 )
357
- assert np .array (actual ) == pytest .approx (expected , abs = 0 , rel = 0.1 )
362
+ assert np .array (actual ) == pytest .approx (expected , abs = 0 , rel = 0.01 )
363
+ assert actual == pytest .approx (np .array (expected ), abs = 0 , rel = 0.01 )
364
+ assert np .array (actual ) == pytest .approx (np .array (expected ), abs = 0 , rel = 0.01 )
358
365
359
366
def test_numpy_array_wrong_shape (self ):
360
367
np = pytest .importorskip ("numpy" )
0 commit comments