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/fixtures.py | testing/python/fixtures.py | 4,060 | FixtureRequest | ref | function | request = FixtureRequest(items[0], _ispytest=True)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,063 | test_func_closure_scopes_reordered | def | function | def test_func_closure_scopes_reordered(self, pytester: Pytester) -> None:
"""Test ensures that fixtures are ordered by scope regardless of the order of the parameters, although
fixtures of same scope keep the declared order
"""
pytester.makepyfile(
"""
import ... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,067 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,092 | inline_genitems | ref | function | items, _ = pytester.inline_genitems()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,093 | FixtureRequest | ref | function | request = FixtureRequest(items[0], _ispytest=True)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,096 | test_func_closure_same_scope_closer_root_first | def | function | def test_func_closure_same_scope_closer_root_first(
self, pytester: Pytester
) -> None:
"""Auto-use fixtures of same scope are ordered by closer-to-root first"""
pytester.makeconftest(
"""
import pytest
@pytest.fixture(scope='module', autouse=_True)
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,100 | makeconftest | ref | function | pytester.makeconftest(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,108 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,134 | inline_genitems | ref | function | items, _ = pytester.inline_genitems()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,135 | FixtureRequest | ref | function | request = FixtureRequest(items[0], _ispytest=True)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,138 | test_func_closure_all_scopes_complex | def | function | def test_func_closure_all_scopes_complex(self, pytester: Pytester) -> None:
"""Complex test involving all scopes and mixing autouse with normal fixtures"""
pytester.makeconftest(
"""
import pytest
@pytest.fixture(scope='session')
def s1(): pass
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,140 | makeconftest | ref | function | pytester.makeconftest(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,151 | makepyfile | ref | function | pytester.makepyfile(**{"__init__.py": ""})
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,152 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,178 | inline_genitems | ref | function | items, _ = pytester.inline_genitems()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,179 | FixtureRequest | ref | function | request = FixtureRequest(items[0], _ispytest=True)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,182 | test_multiple_packages | def | function | def test_multiple_packages(self, pytester: Pytester) -> None:
"""Complex test involving multiple package fixtures. Make sure teardowns
are executed in order.
.
└── root
├── __init__.py
├── sub1
│ ├── __init__.py
│ ├── conftest.py
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,249 | inline_run | ref | function | reprec = pytester.inline_run()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,250 | assertoutcome | ref | function | reprec.assertoutcome(passed=2)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,252 | test_class_fixture_self_instance | def | class | |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,256 | makeconftest | ref | function | pytester.makeconftest(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,274 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,281 | inline_run | ref | function | reprec = pytester.inline_run()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,282 | assertoutcome | ref | function | reprec.assertoutcome(passed=1)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,285 | test_call_fixture_function_error | def | function | def test_call_fixture_function_error():
"""Check if an error is raised if a fixture function is called directly (#4545)"""
@pytest.fixture
def fix():
raise NotImplementedError()
with pytest.raises(pytest.fail.Exception):
assert fix() == 1
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,289 | fix | def | function | def fix():
values.append(1)
pytest.skip('skipping')
def test_1(fix):
pass
def test_2(fix):
pass
def test_last():
assert values == [1]
"""
)
reprec = pytester.inline_run()
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,292 | raises | ref | function | with pytest.raises(pytest.fail.Exception):
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,293 | fix | ref | function | assert fix() == 1
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,296 | test_fixture_param_shadowing | def | function | def test_fixture_param_shadowing(pytester: Pytester) -> None:
"""Parametrized arguments would be shadowed if a fixture with the same name also exists (#5036)"""
pytester.makepyfile(
"""
import pytest
@pytest.fixture(params=['a', 'b'])
def argroot(request):
return req... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,298 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,331 | runpytest | ref | function | result = pytester.runpytest("-v")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,332 | assert_outcomes | ref | function | result.assert_outcomes(passed=4)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,333 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(["*::test_direct[[]1[]]*"])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,334 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(["*::test_normal_fixture[[]a[]]*"])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,335 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(["*::test_normal_fixture[[]b[]]*"])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,336 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(["*::test_indirect[[]1[]]*"])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,339 | test_fixture_named_request | def | function | def test_fixture_named_request(pytester: Pytester) -> None:
pytester.copy_example("fixtures/test_fixture_named_request.py")
result = pytester.runpytest()
result.stdout.fnmatch_lines(
[
"*'request' is a reserved word for fixtures, use another name:",
" *test_fixture_named_req... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,340 | copy_example | ref | function | pytester.copy_example("fixtures/test_fixture_named_request.py")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,341 | runpytest | ref | function | result = pytester.runpytest()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,342 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,350 | test_indirect_fixture_does_not_break_scope | def | function | def test_indirect_fixture_does_not_break_scope(pytester: Pytester) -> None:
"""Ensure that fixture scope is respected when using indirect fixtures (#570)"""
pytester.makepyfile(
"""
import pytest
instantiated = []
@pytest.fixture(scope="session")
def fixture_1(request):... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,352 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,397 | runpytest | ref | function | result = pytester.runpytest()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,398 | assert_outcomes | ref | function | result.assert_outcomes(passed=7)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,401 | test_fixture_parametrization_nparray | def | function | def test_fixture_parametrization_nparray(pytester: Pytester) -> None:
pytest.importorskip("numpy")
pytester.makepyfile(
"""
from numpy import linspace
from pytest import fixture
@fixture(params=linspace(1, 10, 10))
def value(request):
return request.param
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,402 | importorskip | ref | function | pytest.importorskip("numpy")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,404 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,417 | runpytest | ref | function | result = pytester.runpytest()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,418 | assert_outcomes | ref | function | result.assert_outcomes(passed=10)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,421 | test_fixture_arg_ordering | def | function | def test_fixture_arg_ordering(pytester: Pytester) -> None:
"""
This test describes how fixtures in the same scope but without explicit dependencies
between them are created. While users should make dependencies explicit, often
they rely on this order, so this test exists to catch regressions in this reg... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,428 | makepyfile | ref | function | p1 = pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,452 | runpytest | ref | function | result = pytester.runpytest("-vv", str(p1))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,456 | test_yield_fixture_with_no_value | def | function | def test_yield_fixture_with_no_value(pytester: Pytester) -> None:
pytester.makepyfile(
"""
import pytest
@pytest.fixture(name='custom')
def empty_yield():
if _False:
yield
def test_fixt(custom):
pass
"""
)
expected = "E... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,457 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,470 | runpytest | ref | function | result = pytester.runpytest()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,471 | assert_outcomes | ref | function | result.assert_outcomes(errors=1)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/fixtures.py | testing/python/fixtures.py | 4,472 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines([expected])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 10 | TestOEJSKITSpecials | def | class | test_funcarg_non_pycollectobj test_autouse_fixture |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 11 | test_funcarg_non_pycollectobj | def | function | def test_funcarg_non_pycollectobj(
self, pytester: Pytester, recwarn
) -> None: # rough jstests usage
pytester.makeconftest(
"""
import pytest
def pytest_pycollect_makeitem(collector, name, obj):
if name == "MyClass":
retur... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 14 | makeconftest | ref | function | pytester.makeconftest(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 25 | getmodulecol | ref | function | modcol = pytester.getmodulecol(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 36 | collect_one_node | ref | function | rep = runner.collect_one_node(collector=modcol)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 41 | _fillfuncargs | ref | function | pytest._fillfuncargs(clscol)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 44 | test_autouse_fixture | def | function | def test_autouse_fixture(
self, pytester: Pytester, recwarn
) -> None: # rough jstests usage
pytester.makeconftest(
"""
import pytest
def pytest_pycollect_makeitem(collector, name, obj):
if name == "MyClass":
return MyColle... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 47 | makeconftest | ref | function | pytester.makeconftest(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 58 | getmodulecol | ref | function | modcol = pytester.getmodulecol(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 72 | collect_one_node | ref | function | rep = runner.collect_one_node(modcol)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 77 | _fillfuncargs | ref | function | pytest._fillfuncargs(clscol)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 81 | test_wrapped_getfslineno | def | function | def test_wrapped_getfslineno() -> None:
def func():
pass
def wrap(f):
func.__wrapped__ = f # type: ignore
func.patchings = ["qwe"] # type: ignore
return func
@wrap
def wrapped_func(x, y, z):
pass
fs, lineno = getfslineno(wrapped_func)
fs2, lineno2 = g... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 82 | func | def | function | def func():
pass
def wrap(f):
func.__wrapped__ = f # type: ignore
func.patchings = ["qwe"] # type: ignore
return func
@wrap
def wrapped_func(x, y, z):
pass
fs, lineno = getfslineno(wrapped_func)
fs2, lineno2 = getfslineno(wrap)
assert lineno > lin... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 85 | wrap | def | function | def wrap(f):
func.__wrapped__ = f # type: ignore
func.patchings = ["qwe"] # type: ignore
return func
@wrap
def wrapped_func(x, y, z):
pass
fs, lineno = getfslineno(wrapped_func)
fs2, lineno2 = getfslineno(wrap)
assert lineno > lineno2, "getfslineno does not un... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 91 | wrapped_func | def | function | def wrapped_func(x, y, z):
pass
fs, lineno = getfslineno(wrapped_func)
fs2, lineno2 = getfslineno(wrap)
assert lineno > lineno2, "getfslineno does not unwrap correctly"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 94 | getfslineno | ref | function | fs, lineno = getfslineno(wrapped_func)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 95 | getfslineno | ref | function | fs2, lineno2 = getfslineno(wrap)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 99 | TestMockDecoration | def | class | test_wrapped_getfuncargnames test_getfuncargnames_patching test_unittest_mock test_unittest_mock_and_fixture test_unittest_mock_and_pypi_mock test_mock_sentinel_check_against_numpy_like test_mock test_mock_sorting test_mock_double_patch_issue473 |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 100 | test_wrapped_getfuncargnames | def | function | def test_wrapped_getfuncargnames(self) -> None:
from _pytest.compat import getfuncargnames
def wrap(f):
def func():
pass
func.__wrapped__ = f # type: ignore
return func
@wrap
def f(x):
pass
values = getfunca... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 103 | wrap | def | function | def wrap(f):
def func():
pass
func.__wrapped__ = f # type: ignore
return func
@wrap
def f(x):
pass
values = getfuncargnames(f)
assert values == ("x",)
def test_getfuncargnames_patching(self):
from _p... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 104 | func | def | function | def func():
pass
func.__wrapped__ = f # type: ignore
return func
@wrap
def f(x):
pass
values = getfuncargnames(f)
assert values == ("x",)
def test_getfuncargnames_patching(self):
from _pytest.compat import g... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 111 | f | def | function | def f(x):
pass
values = getfuncargnames(f)
assert values == ("x",)
def test_getfuncargnames_patching(self):
from _pytest.compat import getfuncargnames
from unittest.mock import patch
class T:
def original(self, x, y, z):
pass... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 114 | getfuncargnames | ref | function | values = getfuncargnames(f)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 117 | test_getfuncargnames_patching | def | function | def test_getfuncargnames_patching(self):
from _pytest.compat import getfuncargnames
from unittest.mock import patch
class T:
def original(self, x, y, z):
pass
@patch.object(T, "original")
def f(x, y, z):
pass
values = getfunc... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 121 | T | def | class | original |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 122 | original | def | function | def original(self, x, y, z):
pass
@patch.object(T, "original")
def f(x, y, z):
pass
values = getfuncargnames(f)
assert values == ("y", "z")
def test_unittest_mock(self, pytester: Pytester) -> None:
pytester.makepyfile(
""... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 126 | f | def | function | def f(x, y, z):
pass
values = getfuncargnames(f)
assert values == ("y", "z")
def test_unittest_mock(self, pytester: Pytester) -> None:
pytester.makepyfile(
"""
import unittest.mock
class T(unittest.TestCase):
@unittest... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 129 | getfuncargnames | ref | function | values = getfuncargnames(f)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 132 | test_unittest_mock | def | function | def test_unittest_mock(self, pytester: Pytester) -> None:
pytester.makepyfile(
"""
import unittest.mock
class T(unittest.TestCase):
@unittest.mock.patch("os.path.abspath")
def test_hello(self, abspath):
import os
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 133 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 144 | inline_run | ref | function | reprec = pytester.inline_run()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 145 | assertoutcome | ref | function | reprec.assertoutcome(passed=1)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 147 | test_unittest_mock_and_fixture | def | function | def test_unittest_mock_and_fixture(self, pytester: Pytester) -> None:
pytester.makepyfile(
"""
import os.path
import unittest.mock
import pytest
@pytest.fixture
def inject_me():
pass
@unittest.mock.patch.ob... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 148 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 165 | inline_run | ref | function | reprec = pytester.inline_run()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 166 | assertoutcome | ref | function | reprec.assertoutcome(passed=1)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 168 | test_unittest_mock_and_pypi_mock | def | function | def test_unittest_mock_and_pypi_mock(self, pytester: Pytester) -> None:
pytest.importorskip("mock", "1.0.1")
pytester.makepyfile(
"""
import mock
import unittest.mock
class TestBoth(object):
@unittest.mock.patch("os.path.abspath")
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 169 | importorskip | ref | function | pytest.importorskip("mock", "1.0.1")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 170 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 188 | inline_run | ref | function | reprec = pytester.inline_run()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 189 | assertoutcome | ref | function | reprec.assertoutcome(passed=2)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 191 | test_mock_sentinel_check_against_numpy_like | def | function | def test_mock_sentinel_check_against_numpy_like(self, pytester: Pytester) -> None:
"""Ensure our function that detects mock arguments compares against sentinels using
identity to circumvent objects which can't be compared with equality against others
in a truth context, like with numpy array... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/integration.py | testing/python/integration.py | 196 | makepyfile | ref | function | pytester.makepyfile(
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.