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/plugins_integration/bdd_wallet.py | testing/plugins_integration/bdd_wallet.py | 31 | when | ref | function | @when("I buy some bananas for 2")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/plugins_integration/bdd_wallet.py | testing/plugins_integration/bdd_wallet.py | 32 | buy_bananas | def | function | def buy_bananas(wallet):
wallet.amount -= 2
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/plugins_integration/bdd_wallet.py | testing/plugins_integration/bdd_wallet.py | 36 | then | ref | function | @then("I have 47 left")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/plugins_integration/bdd_wallet.py | testing/plugins_integration/bdd_wallet.py | 37 | check | def | function | def check(wallet):
assert wallet.amount == 47
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/plugins_integration/pytest_anyio_integration.py | testing/plugins_integration/pytest_anyio_integration.py | 6 | test_sleep | def | function | async def test_sleep():
await anyio.sleep(0)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/plugins_integration/pytest_anyio_integration.py | testing/plugins_integration/pytest_anyio_integration.py | 7 | sleep | ref | function | await anyio.sleep(0)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/plugins_integration/pytest_asyncio_integration.py | testing/plugins_integration/pytest_asyncio_integration.py | 6 | test_sleep | def | function | async def test_sleep():
await asyncio.sleep(0)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/plugins_integration/pytest_asyncio_integration.py | testing/plugins_integration/pytest_asyncio_integration.py | 7 | sleep | ref | function | await asyncio.sleep(0)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/plugins_integration/pytest_mock_integration.py | testing/plugins_integration/pytest_mock_integration.py | 0 | test_mocker | def | function | def test_mocker(mocker):
mocker.MagicMock()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/plugins_integration/pytest_mock_integration.py | testing/plugins_integration/pytest_mock_integration.py | 1 | MagicMock | ref | function | mocker.MagicMock()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/plugins_integration/pytest_trio_integration.py | testing/plugins_integration/pytest_trio_integration.py | 6 | test_sleep | def | function | async def test_sleep():
await trio.sleep(0)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/plugins_integration/pytest_trio_integration.py | testing/plugins_integration/pytest_trio_integration.py | 7 | sleep | ref | function | await trio.sleep(0)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/plugins_integration/pytest_twisted_integration.py | testing/plugins_integration/pytest_twisted_integration.py | 4 | sleep | def | function | def sleep():
import twisted.internet.reactor
return deferLater(clock=twisted.internet.reactor, delay=0)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/plugins_integration/pytest_twisted_integration.py | testing/plugins_integration/pytest_twisted_integration.py | 7 | deferLater | ref | function | return deferLater(clock=twisted.internet.reactor, delay=0)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/plugins_integration/pytest_twisted_integration.py | testing/plugins_integration/pytest_twisted_integration.py | 11 | test_inlineCallbacks | def | function | def test_inlineCallbacks():
yield sleep()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/plugins_integration/pytest_twisted_integration.py | testing/plugins_integration/pytest_twisted_integration.py | 12 | sleep | ref | function | yield sleep()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/plugins_integration/pytest_twisted_integration.py | testing/plugins_integration/pytest_twisted_integration.py | 16 | test_inlineCallbacks_async | def | function | async def test_inlineCallbacks_async():
await sleep()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/plugins_integration/pytest_twisted_integration.py | testing/plugins_integration/pytest_twisted_integration.py | 17 | sleep | ref | function | await sleep()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/plugins_integration/simple_integration.py | testing/plugins_integration/simple_integration.py | 3 | test_foo | def | function | def test_foo():
assert _True
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/plugins_integration/simple_integration.py | testing/plugins_integration/simple_integration.py | 7 | parametrize | ref | function | @pytest.mark.parametrize("i", range(3))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/plugins_integration/simple_integration.py | testing/plugins_integration/simple_integration.py | 8 | test_bar | def | function | def test_bar(i):
assert _True
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 17 | mocked_doctest_runner | def | function | def mocked_doctest_runner(monkeypatch):
import doctest
class MockedPdb:
def __init__(self, out):
pass
def set_trace(self):
raise NotImplementedError("not used")
def reset(self):
pass
def set_continue(self):
pass
monkeypatch... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 20 | MockedPdb | def | class | __init__ set_trace reset set_continue |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 24 | set_trace | def | function | def set_trace(self):
raise NotImplementedError("not used")
def reset(self):
pass
def set_continue(self):
pass
monkeypatch.setattr("doctest._OutputRedirectingPdb", MockedPdb)
class MyDocTestRunner(doctest.DocTestRunner):
def report_failure(s... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 27 | reset | def | function | def reset(self):
pass
def set_continue(self):
pass
monkeypatch.setattr("doctest._OutputRedirectingPdb", MockedPdb)
class MyDocTestRunner(doctest.DocTestRunner):
def report_failure(self, out, test, example, got):
raise AssertionError(
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 30 | set_continue | def | function | def set_continue(self):
pass
monkeypatch.setattr("doctest._OutputRedirectingPdb", MockedPdb)
class MyDocTestRunner(doctest.DocTestRunner):
def report_failure(self, out, test, example, got):
raise AssertionError(
"'{}' evaluates to '{}', not '{}'".format(... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 35 | MyDocTestRunner | def | class | report_failure |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 36 | report_failure | def | function | def report_failure(self, out, test, example, got):
raise AssertionError(
"'{}' evaluates to '{}', not '{}'".format(
example.source.strip(), got.strip(), example.want.strip()
)
)
return MyDocTestRunner()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 43 | MyDocTestRunner | ref | function | return MyDocTestRunner()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 47 | temporary_verbosity | def | function | def temporary_verbosity(config, verbosity=0):
original_verbosity = config.getoption("verbose")
config.option.verbose = verbosity
try:
yield
finally:
config.option.verbose = original_verbosity
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 48 | getoption | ref | function | original_verbosity = config.getoption("verbose")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 57 | assert_approx_raises_regex | def | function | def assert_approx_raises_regex(pytestconfig):
def do_assert(lhs, rhs, expected_message, verbosity_level=0):
import re
with temporary_verbosity(pytestconfig, verbosity_level):
with pytest.raises(AssertionError) as e:
assert lhs == approx(rhs)
nl = "\n"
ob... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 58 | do_assert | def | function | def do_assert(lhs, rhs, expected_message, verbosity_level=0):
import re
with temporary_verbosity(pytestconfig, verbosity_level):
with pytest.raises(AssertionError) as e:
assert lhs == approx(rhs)
nl = "\n"
obtained_message = str(e.value).splitlines()[1:]... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 61 | temporary_verbosity | ref | function | with temporary_verbosity(pytestconfig, verbosity_level):
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 62 | raises | ref | function | with pytest.raises(AssertionError) as e:
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 63 | approx | ref | function | assert lhs == approx(rhs)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 94 | TestApprox | def | class | test_error_messages test_error_messages_invalid_args test_error_messages_with_different_verbosity test_repr_string test_repr_complex_numbers test_repr_nd_array test_bool test_operator_overloading test_exactly_equal test_opposite_sign test_zero_tolerance test_negative_tolerance test_negative_tolerance_message test_inf_t... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 95 | test_error_messages | def | function | def test_error_messages(self, assert_approx_raises_regex):
np = pytest.importorskip("numpy")
assert_approx_raises_regex(
2.0,
1.0,
[
" comparison failed",
f" Obtained: {SOME_FLOAT}",
f" Expected: {SOME_FLOAT} ± {... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 96 | importorskip | ref | function | np = pytest.importorskip("numpy")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 98 | assert_approx_raises_regex | ref | function | assert_approx_raises_regex(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 108 | assert_approx_raises_regex | ref | function | assert_approx_raises_regex(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 125 | assert_approx_raises_regex | ref | function | assert_approx_raises_regex(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 138 | linspace | ref | function | a = np.linspace(0, 100, 20)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 139 | linspace | ref | function | b = np.linspace(0, 100, 20)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 141 | assert_approx_raises_regex | ref | function | assert_approx_raises_regex(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 153 | assert_approx_raises_regex | ref | function | assert_approx_raises_regex(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 154 | array | ref | function | np.array(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 160 | array | ref | function | np.array(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 178 | assert_approx_raises_regex | ref | function | assert_approx_raises_regex(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 190 | assert_approx_raises_regex | ref | function | assert_approx_raises_regex(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 191 | array | ref | function | np.array([0.0]),
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 192 | array | ref | function | np.array([1.0]),
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 202 | test_error_messages_invalid_args | def | function | def test_error_messages_invalid_args(self, assert_approx_raises_regex):
np = pytest.importorskip("numpy")
with pytest.raises(AssertionError) as e:
assert np.array([[1.2, 3.4], [4.0, 5.0]]) == pytest.approx(
np.array([[4.0], [5.0]])
)
message = "\n".joi... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 203 | importorskip | ref | function | np = pytest.importorskip("numpy")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 204 | raises | ref | function | with pytest.raises(AssertionError) as e:
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 205 | array | ref | function | assert np.array([[1.2, 3.4], [4.0, 5.0]]) == pytest.approx(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 205 | approx | ref | function | assert np.array([[1.2, 3.4], [4.0, 5.0]]) == pytest.approx(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 206 | array | ref | function | np.array([[4.0], [5.0]])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 216 | raises | ref | function | with pytest.raises(AssertionError) as e:
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 217 | approx | ref | function | assert [1.0, 2.0, 3.0] == pytest.approx([4.0, 5.0])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 226 | test_error_messages_with_different_verbosity | def | function | def test_error_messages_with_different_verbosity(self, assert_approx_raises_regex):
np = pytest.importorskip("numpy")
for v in [0, 1, 2]:
# Verbosity level doesn't affect the error message for scalars
assert_approx_raises_regex(
2.0,
1.0,
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 227 | importorskip | ref | function | np = pytest.importorskip("numpy")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 230 | assert_approx_raises_regex | ref | function | assert_approx_raises_regex(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 241 | linspace | ref | function | a = np.linspace(1, 101, 20)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 242 | linspace | ref | function | b = np.linspace(2, 102, 20)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 243 | assert_approx_raises_regex | ref | function | assert_approx_raises_regex(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 260 | assert_approx_raises_regex | ref | function | assert_approx_raises_regex(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 276 | test_repr_string | def | function | def test_repr_string(self):
assert repr(approx(1.0)) == "1.0 ± 1.0e-06"
assert repr(approx([1.0, 2.0])) == "approx([1.0 ± 1.0e-06, 2.0 ± 2.0e-06])"
assert repr(approx((1.0, 2.0))) == "approx((1.0 ± 1.0e-06, 2.0 ± 2.0e-06))"
assert repr(approx(inf)) == "inf"
assert repr(approx... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 277 | approx | ref | function | assert repr(approx(1.0)) == "1.0 ± 1.0e-06"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 278 | approx | ref | function | assert repr(approx([1.0, 2.0])) == "approx([1.0 ± 1.0e-06, 2.0 ± 2.0e-06])"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 279 | approx | ref | function | assert repr(approx((1.0, 2.0))) == "approx((1.0 ± 1.0e-06, 2.0 ± 2.0e-06))"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 280 | approx | ref | function | assert repr(approx(inf)) == "inf"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 281 | approx | ref | function | assert repr(approx(1.0, rel=nan)) == "1.0 ± ???"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 282 | approx | ref | function | assert repr(approx(1.0, rel=inf)) == "1.0 ± inf"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 285 | approx | ref | function | assert repr(approx({"a": 1.0, "b": 2.0})) in (
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 290 | test_repr_complex_numbers | def | function | def test_repr_complex_numbers(self):
assert repr(approx(inf + 1j)) == "(inf+1j)"
assert repr(approx(1.0j, rel=inf)) == "1j ± inf"
# can't compute a sensible tolerance
assert repr(approx(nan + 1j)) == "(nan+1j) ± ???"
assert repr(approx(1.0j)) == "1j ± 1.0e-06 ∠ ±180°"
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 291 | approx | ref | function | assert repr(approx(inf + 1j)) == "(inf+1j)"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 292 | approx | ref | function | assert repr(approx(1.0j, rel=inf)) == "1j ± inf"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 295 | approx | ref | function | assert repr(approx(nan + 1j)) == "(nan+1j) ± ???"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 297 | approx | ref | function | assert repr(approx(1.0j)) == "1j ± 1.0e-06 ∠ ±180°"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 300 | approx | ref | function | assert repr(approx(3 + 4 * 1j)) == "(3+4j) ± 5.0e-06 ∠ ±180°"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 303 | approx | ref | function | assert repr(approx(3.3 + 4.4 * 1j, abs=0.02)) == "(3.3+4.4j) ± 2.0e-02 ∠ ±180°"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 305 | parametrize | ref | function | @pytest.mark.parametrize(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 315 | test_repr_nd_array | def | function | def test_repr_nd_array(self, value, expected_repr_string):
"""Make sure that arrays of all different dimensions are repr'd correctly."""
np = pytest.importorskip("numpy")
np_array = np.array(value)
assert repr(approx(np_array)) == expected_repr_string
def test_bool(self):
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 317 | importorskip | ref | function | np = pytest.importorskip("numpy")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 318 | array | ref | function | np_array = np.array(value)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 319 | approx | ref | function | assert repr(approx(np_array)) == expected_repr_string
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 321 | test_bool | def | function | def test_bool(self):
with pytest.raises(AssertionError) as err:
assert approx(1)
assert err.match(r"approx\(\) is not supported in a boolean context")
def test_operator_overloading(self):
assert 1 == approx(1, rel=1e-6, abs=1e-12)
assert not (1 != approx(1, rel=1e-6... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 322 | raises | ref | function | with pytest.raises(AssertionError) as err:
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 323 | approx | ref | function | assert approx(1)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 327 | test_operator_overloading | def | function | def test_operator_overloading(self):
assert 1 == approx(1, rel=1e-6, abs=1e-12)
assert not (1 != approx(1, rel=1e-6, abs=1e-12))
assert 10 != approx(1, rel=1e-6, abs=1e-12)
assert not (10 == approx(1, rel=1e-6, abs=1e-12))
def test_exactly_equal(self):
examples = [
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 328 | approx | ref | function | assert 1 == approx(1, rel=1e-6, abs=1e-12)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 329 | approx | ref | function | assert not (1 != approx(1, rel=1e-6, abs=1e-12))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 330 | approx | ref | function | assert 10 != approx(1, rel=1e-6, abs=1e-12)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 331 | approx | ref | function | assert not (10 == approx(1, rel=1e-6, abs=1e-12))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 333 | test_exactly_equal | def | function | def test_exactly_equal(self):
examples = [
(2.0, 2.0),
(0.1e200, 0.1e200),
(1.123e-300, 1.123e-300),
(12345, 12345.0),
(0.0, -0.0),
(345678, 345678),
(Decimal("1.0001"), Decimal("1.0001")),
(Fraction(1, 3), Fract... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 345 | approx | ref | function | assert a == approx(x)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 347 | test_opposite_sign | def | function | def test_opposite_sign(self):
examples = [(eq, 1e-100, -1e-100), (ne, 1e100, -1e100)]
for op, a, x in examples:
assert op(a, approx(x))
def test_zero_tolerance(self):
within_1e10 = [(1.1e-100, 1e-100), (-1.1e-100, -1e-100)]
for a, x in within_1e10:
assert... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 350 | op | ref | function | assert op(a, approx(x))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py | testing/python/approx.py | 350 | approx | ref | function | assert op(a, approx(x))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.