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/test_warnings.py
testing/test_warnings.py
558
fnmatch_lines
ref
function
result.stdout.fnmatch_lines(["*PytestAssertRewriteWarning: %s*" % msg])
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
560
test_tuple_warning
def
function
def test_tuple_warning(self, pytester: Pytester) -> None: pytester.makepyfile( """\ def test_foo(): assert (1,2) """ ) result = pytester.runpytest() self.assert_result_warns( result, "assertion is always true, perhaps re...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
561
makepyfile
ref
function
pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
567
runpytest
ref
function
result = pytester.runpytest()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
568
assert_result_warns
ref
function
self.assert_result_warns(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
573
test_warnings_checker_twice
def
function
def test_warnings_checker_twice() -> None: """Issue #4617""" expectation = pytest.warns(UserWarning) with expectation: warnings.warn("Message A", UserWarning) with expectation: warnings.warn("Message B", UserWarning)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
575
warns
ref
function
expectation = pytest.warns(UserWarning)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
577
warn
ref
function
warnings.warn("Message A", UserWarning)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
579
warn
ref
function
warnings.warn("Message B", UserWarning)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
582
filterwarnings
ref
function
@pytest.mark.filterwarnings("always::UserWarning")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
583
test_group_warnings_by_message
def
function
def test_group_warnings_by_message(pytester: Pytester) -> None: pytester.copy_example("warnings/test_group_warnings_by_message.py") result = pytester.runpytest() result.stdout.fnmatch_lines( [ "*== %s ==*" % WARNINGS_SUMMARY_HEADER, "test_group_warnings_by_message.py::test_fo...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
584
copy_example
ref
function
pytester.copy_example("warnings/test_group_warnings_by_message.py")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
585
runpytest
ref
function
result = pytester.runpytest()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
586
fnmatch_lines
ref
function
result.stdout.fnmatch_lines(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
613
filterwarnings
ref
function
@pytest.mark.filterwarnings("always::UserWarning")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
614
test_group_warnings_by_message_summary
def
function
def test_group_warnings_by_message_summary(pytester: Pytester) -> None: pytester.copy_example("warnings/test_group_warnings_by_message_summary") pytester.syspathinsert() result = pytester.runpytest() result.stdout.fnmatch_lines( [ "*== %s ==*" % WARNINGS_SUMMARY_HEADER, "...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
615
copy_example
ref
function
pytester.copy_example("warnings/test_group_warnings_by_message_summary")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
616
syspathinsert
ref
function
pytester.syspathinsert()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
617
runpytest
ref
function
result = pytester.runpytest()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
618
fnmatch_lines
ref
function
result.stdout.fnmatch_lines(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
637
test_pytest_configure_warning
def
function
def test_pytest_configure_warning(pytester: Pytester, recwarn) -> None: """Issue 5115.""" pytester.makeconftest( """ def pytest_configure(): import warnings warnings.warn("from pytest_configure") """ ) result = pytester.runpytest() assert result.ret ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
639
makeconftest
ref
function
pytester.makeconftest(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
648
runpytest
ref
function
result = pytester.runpytest()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
655
TestStackLevel
def
class
capwarn test_issue4445_rewrite test_issue4445_preparse test_conftest_warning_captured test_issue4445_import_plugin test_issue4445_issue5928_mark_generator
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
657
capwarn
def
function
def capwarn(self, pytester: Pytester): class CapturedWarnings: captured: List[ Tuple[warnings.WarningMessage, Optional[Tuple[str, int, str]]] ] = [] @classmethod def pytest_warning_recorded(cls, warning_message, when, nodeid, location): ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
658
CapturedWarnings
def
class
pytest_warning_recorded
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
664
pytest_warning_recorded
def
function
def pytest_warning_recorded(cls, warning_message, when, nodeid, location): cls.captured.append((warning_message, location)) pytester.plugins = [CapturedWarnings()] return CapturedWarnings def test_issue4445_rewrite(self, pytester: Pytester, capwarn) -> None: ""...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
667
CapturedWarnings
ref
function
pytester.plugins = [CapturedWarnings()]
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
671
test_issue4445_rewrite
def
function
def test_issue4445_rewrite(self, pytester: Pytester, capwarn) -> None: """#4445: Make sure the warning points to a reasonable location See origin of _issue_warning_captured at: _pytest.assertion.rewrite.py:241 """ pytester.makepyfile(some_mod="") conftest = pytester.makeconft...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
675
makepyfile
ref
function
pytester.makepyfile(some_mod="")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
676
makeconftest
ref
function
conftest = pytester.makeconftest(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
684
parseconfig
ref
function
pytester.parseconfig()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
697
test_issue4445_preparse
def
function
def test_issue4445_preparse(self, pytester: Pytester, capwarn) -> None: """#4445: Make sure the warning points to a reasonable location See origin of _issue_warning_captured at: _pytest.config.__init__.py:910 """ pytester.makeconftest( """ import nothing ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
701
makeconftest
ref
function
pytester.makeconftest(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
706
parseconfig
ref
function
pytester.parseconfig("--help")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
718
filterwarnings
ref
function
@pytest.mark.filterwarnings("default")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
719
test_conftest_warning_captured
def
function
def test_conftest_warning_captured(self, pytester: Pytester) -> None: """Warnings raised during importing of conftest.py files is captured (#2891).""" pytester.makeconftest( """ import warnings warnings.warn(UserWarning("my custom warning")) """ ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
721
makeconftest
ref
function
pytester.makeconftest(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
727
runpytest
ref
function
result = pytester.runpytest()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
728
fnmatch_lines
ref
function
result.stdout.fnmatch_lines(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
732
test_issue4445_import_plugin
def
function
def test_issue4445_import_plugin(self, pytester: Pytester, capwarn) -> None: """#4445: Make sure the warning points to a reasonable location""" pytester.makepyfile( some_plugin=""" import pytest pytest.skip("thing", allow_module_level=_True) """ ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
734
makepyfile
ref
function
pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
740
syspathinsert
ref
function
pytester.syspathinsert()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
741
parseconfig
ref
function
pytester.parseconfig("-p", "some_plugin")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
754
test_issue4445_issue5928_mark_generator
def
function
def test_issue4445_issue5928_mark_generator(self, pytester: Pytester) -> None: """#4445 and #5928: Make sure the warning from an unknown mark points to the test file where this mark is used. """ testfile = pytester.makepyfile( """ import pytest @p...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
758
makepyfile
ref
function
testfile = pytester.makepyfile(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
767
runpytest_subprocess
ref
function
result = pytester.runpytest_subprocess()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_warnings.py
testing/test_warnings.py
769
fnmatch_lines_random
ref
function
result.stdout.fnmatch_lines_random(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/typing_checks.py
testing/typing_checks.py
9
xfail
ref
function
@pytest.mark.xfail(raises=RuntimeError)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/typing_checks.py
testing/typing_checks.py
10
check_mark_xfail_raises
def
function
def check_mark_xfail_raises() -> None: pass
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/typing_checks.py
testing/typing_checks.py
15
fixture
ref
function
@pytest.fixture(params=[(0, 0), (1, 1)], ids=lambda x: str(x[0]))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/typing_checks.py
testing/typing_checks.py
16
check_fixture_ids_callable
def
function
def check_fixture_ids_callable() -> None: pass
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/typing_checks.py
testing/typing_checks.py
21
parametrize
ref
function
@pytest.mark.parametrize("func", [str, int], ids=lambda x: str(x.__name__))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/typing_checks.py
testing/typing_checks.py
22
check_parametrize_ids_callable
def
function
def check_parametrize_ids_callable(func) -> None: pass