fname
stringlengths
63
176
rel_fname
stringclasses
706 values
line
int64
-1
4.5k
name
stringlengths
1
81
kind
stringclasses
2 values
category
stringclasses
2 values
info
stringlengths
0
77.9k
⌀
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
352
test_zero_tolerance
def
function
def test_zero_tolerance(self): within_1e10 = [(1.1e-100, 1e-100), (-1.1e-100, -1e-100)] for a, x in within_1e10: assert x == approx(x, rel=0.0, abs=0.0) assert a != approx(x, rel=0.0, abs=0.0) assert a == approx(x, rel=0.0, abs=5e-101) assert a != appr...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
355
approx
ref
function
assert x == approx(x, rel=0.0, abs=0.0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
356
approx
ref
function
assert a != approx(x, rel=0.0, abs=0.0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
357
approx
ref
function
assert a == approx(x, rel=0.0, abs=5e-101)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
358
approx
ref
function
assert a != approx(x, rel=0.0, abs=5e-102)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
359
approx
ref
function
assert a == approx(x, rel=5e-1, abs=0.0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
360
approx
ref
function
assert a != approx(x, rel=5e-2, abs=0.0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
362
parametrize
ref
function
@pytest.mark.parametrize(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
372
test_negative_tolerance
def
function
def test_negative_tolerance( self, rel: Optional[float], abs: Optional[float] ) -> None: # Negative tolerances are not allowed. with pytest.raises(ValueError): 1.1 == approx(1, rel, abs) def test_negative_tolerance_message(self): # Error message for negative tole...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
376
raises
ref
function
with pytest.raises(ValueError):
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
377
approx
ref
function
1.1 == approx(1, rel, abs)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
379
test_negative_tolerance_message
def
function
def test_negative_tolerance_message(self): # Error message for negative tolerance should include the value. with pytest.raises(ValueError, match="-3"): 0 == approx(1, abs=-3) with pytest.raises(ValueError, match="-3"): 0 == approx(1, rel=-3) def test_inf_toleranc...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
381
raises
ref
function
with pytest.raises(ValueError, match="-3"):
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
382
approx
ref
function
0 == approx(1, abs=-3)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
383
raises
ref
function
with pytest.raises(ValueError, match="-3"):
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
384
approx
ref
function
0 == approx(1, rel=-3)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
386
test_inf_tolerance
def
function
def test_inf_tolerance(self): # Everything should be equal if the tolerance is infinite. large_diffs = [(1, 1000), (1e-50, 1e50), (-1.0, -1e300), (0.0, 10)] for a, x in large_diffs: assert a != approx(x, rel=0.0, abs=0.0) assert a == approx(x, rel=inf, abs=0.0) ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
390
approx
ref
function
assert a != approx(x, rel=0.0, abs=0.0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
391
approx
ref
function
assert a == approx(x, rel=inf, abs=0.0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
392
approx
ref
function
assert a == approx(x, rel=0.0, abs=inf)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
393
approx
ref
function
assert a == approx(x, rel=inf, abs=inf)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
395
test_inf_tolerance_expecting_zero
def
function
def test_inf_tolerance_expecting_zero(self) -> None: # If the relative tolerance is zero but the expected value is infinite, # the actual tolerance is a NaN, which should be an error. with pytest.raises(ValueError): 1 == approx(0, rel=inf, abs=0.0) with pytest.raises(Valu...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
398
raises
ref
function
with pytest.raises(ValueError):
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
399
approx
ref
function
1 == approx(0, rel=inf, abs=0.0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
400
raises
ref
function
with pytest.raises(ValueError):
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
401
approx
ref
function
1 == approx(0, rel=inf, abs=inf)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
403
test_nan_tolerance
def
function
def test_nan_tolerance(self) -> None: with pytest.raises(ValueError): 1.1 == approx(1, rel=nan) with pytest.raises(ValueError): 1.1 == approx(1, abs=nan) with pytest.raises(ValueError): 1.1 == approx(1, rel=nan, abs=nan) def test_reasonable_defaults(s...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
404
raises
ref
function
with pytest.raises(ValueError):
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
405
approx
ref
function
1.1 == approx(1, rel=nan)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
406
raises
ref
function
with pytest.raises(ValueError):
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
407
approx
ref
function
1.1 == approx(1, abs=nan)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
408
raises
ref
function
with pytest.raises(ValueError):
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
409
approx
ref
function
1.1 == approx(1, rel=nan, abs=nan)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
411
test_reasonable_defaults
def
function
def test_reasonable_defaults(self): # Whatever the defaults are, they should work for numbers close to 1 # than have a small amount of floating-point error. assert 0.1 + 0.2 == approx(0.3) def test_default_tolerances(self): # This tests the defaults as they are currently set. I...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
414
approx
ref
function
assert 0.1 + 0.2 == approx(0.3)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
416
test_default_tolerances
def
function
def test_default_tolerances(self): # This tests the defaults as they are currently set. If you change the # defaults, this test will fail but you should feel free to change it. # None of the other tests (except the doctests) should be affected by # the choice of defaults. ex...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
433
op
ref
function
assert op(a, approx(x))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
433
approx
ref
function
assert op(a, approx(x))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
435
test_custom_tolerances
def
function
def test_custom_tolerances(self): assert 1e8 + 1e0 == approx(1e8, rel=5e-8, abs=5e0) assert 1e8 + 1e0 == approx(1e8, rel=5e-9, abs=5e0) assert 1e8 + 1e0 == approx(1e8, rel=5e-8, abs=5e-1) assert 1e8 + 1e0 != approx(1e8, rel=5e-9, abs=5e-1) assert 1e0 + 1e-8 == approx(1e0, re...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
436
approx
ref
function
assert 1e8 + 1e0 == approx(1e8, rel=5e-8, abs=5e0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
437
approx
ref
function
assert 1e8 + 1e0 == approx(1e8, rel=5e-9, abs=5e0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
438
approx
ref
function
assert 1e8 + 1e0 == approx(1e8, rel=5e-8, abs=5e-1)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
439
approx
ref
function
assert 1e8 + 1e0 != approx(1e8, rel=5e-9, abs=5e-1)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
441
approx
ref
function
assert 1e0 + 1e-8 == approx(1e0, rel=5e-8, abs=5e-8)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
442
approx
ref
function
assert 1e0 + 1e-8 == approx(1e0, rel=5e-9, abs=5e-8)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
443
approx
ref
function
assert 1e0 + 1e-8 == approx(1e0, rel=5e-8, abs=5e-9)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
444
approx
ref
function
assert 1e0 + 1e-8 != approx(1e0, rel=5e-9, abs=5e-9)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
446
approx
ref
function
assert 1e-8 + 1e-16 == approx(1e-8, rel=5e-8, abs=5e-16)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
447
approx
ref
function
assert 1e-8 + 1e-16 == approx(1e-8, rel=5e-9, abs=5e-16)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
448
approx
ref
function
assert 1e-8 + 1e-16 == approx(1e-8, rel=5e-8, abs=5e-17)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
449
approx
ref
function
assert 1e-8 + 1e-16 != approx(1e-8, rel=5e-9, abs=5e-17)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
451
test_relative_tolerance
def
function
def test_relative_tolerance(self): within_1e8_rel = [(1e8 + 1e0, 1e8), (1e0 + 1e-8, 1e0), (1e-8 + 1e-16, 1e-8)] for a, x in within_1e8_rel: assert a == approx(x, rel=5e-8, abs=0.0) assert a != approx(x, rel=5e-9, abs=0.0) def test_absolute_tolerance(self): within...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
454
approx
ref
function
assert a == approx(x, rel=5e-8, abs=0.0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
455
approx
ref
function
assert a != approx(x, rel=5e-9, abs=0.0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
457
test_absolute_tolerance
def
function
def test_absolute_tolerance(self): within_1e8_abs = [(1e8 + 9e-9, 1e8), (1e0 + 9e-9, 1e0), (1e-8 + 9e-9, 1e-8)] for a, x in within_1e8_abs: assert a == approx(x, rel=0, abs=5e-8) assert a != approx(x, rel=0, abs=5e-9) def test_expecting_zero(self): examples = [ ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
460
approx
ref
function
assert a == approx(x, rel=0, abs=5e-8)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
461
approx
ref
function
assert a != approx(x, rel=0, abs=5e-9)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
463
test_expecting_zero
def
function
def test_expecting_zero(self): examples = [ (ne, 1e-6, 0.0), (ne, -1e-6, 0.0), (eq, 1e-12, 0.0), (eq, -1e-12, 0.0), (ne, 2e-12, 0.0), (ne, -2e-12, 0.0), (ne, inf, 0.0), (ne, nan, 0.0), ] for op, a...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
475
op
ref
function
assert op(a, approx(x, rel=0.0, abs=1e-12))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
475
approx
ref
function
assert op(a, approx(x, rel=0.0, abs=1e-12))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
476
op
ref
function
assert op(a, approx(x, rel=1e-6, abs=1e-12))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
476
approx
ref
function
assert op(a, approx(x, rel=1e-6, abs=1e-12))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
478
test_expecting_inf
def
function
def test_expecting_inf(self): examples = [ (eq, inf, inf), (eq, -inf, -inf), (ne, inf, -inf), (ne, 0.0, inf), (ne, nan, inf), ] for op, a, x in examples: assert op(a, approx(x)) def test_expecting_nan(self): ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
487
op
ref
function
assert op(a, approx(x))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
487
approx
ref
function
assert op(a, approx(x))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
489
test_expecting_nan
def
function
def test_expecting_nan(self): examples = [ (eq, nan, nan), (eq, -nan, -nan), (eq, nan, -nan), (ne, 0.0, nan), (ne, inf, nan), ] for op, a, x in examples: # Nothing is equal to NaN by default. assert a != appr...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
499
approx
ref
function
assert a != approx(x)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
502
op
ref
function
assert op(a, approx(x, nan_ok=True))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
502
approx
ref
function
assert op(a, approx(x, nan_ok=True))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
504
test_int
def
function
def test_int(self): within_1e6 = [(1000001, 1000000), (-1000001, -1000000)] for a, x in within_1e6: assert a == approx(x, rel=5e-6, abs=0) assert a != approx(x, rel=5e-7, abs=0) assert approx(x, rel=5e-6, abs=0) == a assert approx(x, rel=5e-7, abs=0) !...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
507
approx
ref
function
assert a == approx(x, rel=5e-6, abs=0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
508
approx
ref
function
assert a != approx(x, rel=5e-7, abs=0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
509
approx
ref
function
assert approx(x, rel=5e-6, abs=0) == a
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
510
approx
ref
function
assert approx(x, rel=5e-7, abs=0) != a
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
512
test_decimal
def
function
def test_decimal(self): within_1e6 = [ (Decimal("1.000001"), Decimal("1.0")), (Decimal("-1.000001"), Decimal("-1.0")), ] for a, x in within_1e6: assert a == approx(x) assert a == approx(x, rel=Decimal("5e-6"), abs=0) assert a != app...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
518
approx
ref
function
assert a == approx(x)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
519
approx
ref
function
assert a == approx(x, rel=Decimal("5e-6"), abs=0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
520
approx
ref
function
assert a != approx(x, rel=Decimal("5e-7"), abs=0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
521
approx
ref
function
assert approx(x, rel=Decimal("5e-6"), abs=0) == a
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
522
approx
ref
function
assert approx(x, rel=Decimal("5e-7"), abs=0) != a
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
524
test_fraction
def
function
def test_fraction(self): within_1e6 = [ (1 + Fraction(1, 1000000), Fraction(1)), (-1 - Fraction(-1, 1000000), Fraction(-1)), ] for a, x in within_1e6: assert a == approx(x, rel=5e-6, abs=0) assert a != approx(x, rel=5e-7, abs=0) ass...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
530
approx
ref
function
assert a == approx(x, rel=5e-6, abs=0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
531
approx
ref
function
assert a != approx(x, rel=5e-7, abs=0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
532
approx
ref
function
assert approx(x, rel=5e-6, abs=0) == a
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
533
approx
ref
function
assert approx(x, rel=5e-7, abs=0) != a
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
535
test_complex
def
function
def test_complex(self): within_1e6 = [ (1.000001 + 1.0j, 1.0 + 1.0j), (1.0 + 1.000001j, 1.0 + 1.0j), (-1.000001 + 1.0j, -1.0 + 1.0j), (1.0 - 1.000001j, 1.0 - 1.0j), ] for a, x in within_1e6: assert a == approx(x, rel=5e-6, abs=0) ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
543
approx
ref
function
assert a == approx(x, rel=5e-6, abs=0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
544
approx
ref
function
assert a != approx(x, rel=5e-7, abs=0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
545
approx
ref
function
assert approx(x, rel=5e-6, abs=0) == a
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
546
approx
ref
function
assert approx(x, rel=5e-7, abs=0) != a
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
548
test_list
def
function
def test_list(self): actual = [1 + 1e-7, 2 + 1e-8] expected = [1, 2] # Return false if any element is outside the tolerance. assert actual == approx(expected, rel=5e-7, abs=0) assert actual != approx(expected, rel=5e-8, abs=0) assert approx(expected, rel=5e-7, abs=0)...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
553
approx
ref
function
assert actual == approx(expected, rel=5e-7, abs=0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
554
approx
ref
function
assert actual != approx(expected, rel=5e-8, abs=0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
555
approx
ref
function
assert approx(expected, rel=5e-7, abs=0) == actual
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
556
approx
ref
function
assert approx(expected, rel=5e-8, abs=0) != actual
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
558
test_list_decimal
def
function
def test_list_decimal(self): actual = [Decimal("1.000001"), Decimal("2.000001")] expected = [Decimal("1"), Decimal("2")] assert actual == approx(expected) def test_list_wrong_len(self): assert [1, 2] != approx([1]) assert [1, 2] != approx([1, 2, 3]) def test_tuple(...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
562
approx
ref
function
assert actual == approx(expected)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
564
test_list_wrong_len
def
function
def test_list_wrong_len(self): assert [1, 2] != approx([1]) assert [1, 2] != approx([1, 2, 3]) def test_tuple(self): actual = (1 + 1e-7, 2 + 1e-8) expected = (1, 2) # Return false if any element is outside the tolerance. assert actual == approx(expected, rel=5e-...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
565
approx
ref
function
assert [1, 2] != approx([1])
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
566
approx
ref
function
assert [1, 2] != approx([1, 2, 3])