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_pytester.py | testing/test_pytester.py | 205 | makepyfile | ref | function | pytester.makepyfile(chr(0xFFFD))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 208 | test_makepyfile_utf8 | def | function | def test_makepyfile_utf8(pytester: Pytester) -> None:
"""Ensure makepyfile accepts utf-8 bytes as input (#2738)"""
utf8_contents = """
def setup_function(function):
mixed_encoding = 'São Paulo'
""".encode()
p = pytester.makepyfile(utf8_contents)
assert "mixed_encoding = 'São Paul... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 214 | makepyfile | ref | function | p = pytester.makepyfile(utf8_contents)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 218 | TestInlineRunModulesCleanup | def | class | test_inline_run_test_module_not_cleaned_up spy_factory test_inline_run_taking_and_restoring_a_sys_modules_snapshot test_inline_run_sys_modules_snapshot_restore_preserving_modules test_external_test_module_imports_not_cleaned_up |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 219 | test_inline_run_test_module_not_cleaned_up | def | function | def test_inline_run_test_module_not_cleaned_up(self, pytester: Pytester) -> None:
test_mod = pytester.makepyfile("def test_foo(): assert _True")
result = pytester.inline_run(str(test_mod))
assert result.ret == ExitCode.OK
# rewrite module, now test should fail if module was re-import... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 220 | makepyfile | ref | function | test_mod = pytester.makepyfile("def test_foo(): assert True")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 221 | inline_run | ref | function | result = pytester.inline_run(str(test_mod))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 225 | inline_run | ref | function | result2 = pytester.inline_run(str(test_mod))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 228 | spy_factory | def | function | def spy_factory(self):
class SysModulesSnapshotSpy:
instances: List["SysModulesSnapshotSpy"] = [] # noqa: F821
def __init__(self, preserve=None) -> None:
SysModulesSnapshotSpy.instances.append(self)
self._spy_restore_count = 0
self._s... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 229 | SysModulesSnapshotSpy | def | class | __init__ restore |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 236 | SysModulesSnapshot | ref | function | self.__snapshot = SysModulesSnapshot(preserve=preserve)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 238 | restore | def | function | def restore(self):
self._spy_restore_count += 1
return self.__snapshot.restore()
return SysModulesSnapshotSpy
def test_inline_run_taking_and_restoring_a_sys_modules_snapshot(
self, pytester: Pytester, monkeypatch: MonkeyPatch
) -> None:
spy_f... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 240 | restore | ref | function | return self.__snapshot.restore()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 244 | test_inline_run_taking_and_restoring_a_sys_modules_snapshot | def | function | def test_inline_run_taking_and_restoring_a_sys_modules_snapshot(
self, pytester: Pytester, monkeypatch: MonkeyPatch
) -> None:
spy_factory = self.spy_factory()
monkeypatch.setattr(pytester_mod, "SysModulesSnapshot", spy_factory)
pytester.syspathinsert()
original = dict(sy... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 247 | spy_factory | ref | function | spy_factory = self.spy_factory()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 249 | syspathinsert | ref | function | pytester.syspathinsert()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 251 | makepyfile | ref | function | pytester.makepyfile(import1="# you son of a silly person")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 252 | makepyfile | ref | function | pytester.makepyfile(import2="# my hovercraft is full of eels")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 253 | makepyfile | ref | function | test_mod = pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 258 | inline_run | ref | function | pytester.inline_run(str(test_mod))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 265 | test_inline_run_sys_modules_snapshot_restore_preserving_modules | def | function | def test_inline_run_sys_modules_snapshot_restore_preserving_modules(
self, pytester: Pytester, monkeypatch: MonkeyPatch
) -> None:
spy_factory = self.spy_factory()
monkeypatch.setattr(pytester_mod, "SysModulesSnapshot", spy_factory)
test_mod = pytester.makepyfile("def test_foo():... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 268 | spy_factory | ref | function | spy_factory = self.spy_factory()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 270 | makepyfile | ref | function | test_mod = pytester.makepyfile("def test_foo(): pass")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 271 | inline_run | ref | function | pytester.inline_run(str(test_mod))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 273 | _spy_preserve | ref | function | assert not spy._spy_preserve("black_knight")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 274 | _spy_preserve | ref | function | assert spy._spy_preserve("zope")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 275 | _spy_preserve | ref | function | assert spy._spy_preserve("zope.interface")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 276 | _spy_preserve | ref | function | assert spy._spy_preserve("zopelicious")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 278 | test_external_test_module_imports_not_cleaned_up | def | function | def test_external_test_module_imports_not_cleaned_up(
self, pytester: Pytester
) -> None:
pytester.syspathinsert()
pytester.makepyfile(imported="data = 'you son of a silly person'")
import imported
test_mod = pytester.makepyfile(
"""
def test_foo(... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 281 | syspathinsert | ref | function | pytester.syspathinsert()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 282 | makepyfile | ref | function | pytester.makepyfile(imported="data = 'you son of a silly person'")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 285 | makepyfile | ref | function | test_mod = pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 291 | inline_run | ref | function | pytester.inline_run(str(test_mod))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 295 | test_assert_outcomes_after_pytest_error | def | function | def test_assert_outcomes_after_pytest_error(pytester: Pytester) -> None:
pytester.makepyfile("def test_foo(): assert _True")
result = pytester.runpytest("--unexpected-argument")
with pytest.raises(ValueError, match="Pytest terminal summary report not found"):
result.assert_outcomes(passed=0)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 296 | makepyfile | ref | function | pytester.makepyfile("def test_foo(): assert True")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 298 | runpytest | ref | function | result = pytester.runpytest("--unexpected-argument")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 299 | raises | ref | function | with pytest.raises(ValueError, match="Pytest terminal summary report not found"):
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 300 | assert_outcomes | ref | function | result.assert_outcomes(passed=0)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 303 | test_cwd_snapshot | def | function | def test_cwd_snapshot(pytester: Pytester) -> None:
foo = pytester.mkdir("foo")
bar = pytester.mkdir("bar")
os.chdir(foo)
snapshot = CwdSnapshot()
os.chdir(bar)
assert Path().absolute() == bar
snapshot.restore()
assert Path().absolute() == foo
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 307 | CwdSnapshot | ref | function | snapshot = CwdSnapshot()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 310 | restore | ref | function | snapshot.restore()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 314 | TestSysModulesSnapshot | def | class | test_remove_added test_add_removed test_restore_reloaded test_preserve_modules test_preserve_container |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 317 | test_remove_added | def | function | def test_remove_added(self) -> None:
original = dict(sys.modules)
assert self.key not in sys.modules
snapshot = SysModulesSnapshot()
sys.modules[self.key] = ModuleType("something")
assert self.key in sys.modules
snapshot.restore()
assert sys.modules == origina... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 320 | SysModulesSnapshot | ref | function | snapshot = SysModulesSnapshot()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 323 | restore | ref | function | snapshot.restore()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 326 | test_add_removed | def | function | def test_add_removed(self, monkeypatch: MonkeyPatch) -> None:
assert self.key not in sys.modules
monkeypatch.setitem(sys.modules, self.key, ModuleType("something"))
assert self.key in sys.modules
original = dict(sys.modules)
snapshot = SysModulesSnapshot()
del sys.mod... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 328 | setitem | ref | function | monkeypatch.setitem(sys.modules, self.key, ModuleType("something"))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 331 | SysModulesSnapshot | ref | function | snapshot = SysModulesSnapshot()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 334 | restore | ref | function | snapshot.restore()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 337 | test_restore_reloaded | def | function | def test_restore_reloaded(self, monkeypatch: MonkeyPatch) -> None:
assert self.key not in sys.modules
monkeypatch.setitem(sys.modules, self.key, ModuleType("something"))
assert self.key in sys.modules
original = dict(sys.modules)
snapshot = SysModulesSnapshot()
sys.mo... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 339 | setitem | ref | function | monkeypatch.setitem(sys.modules, self.key, ModuleType("something"))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 342 | SysModulesSnapshot | ref | function | snapshot = SysModulesSnapshot()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 344 | restore | ref | function | snapshot.restore()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 347 | test_preserve_modules | def | function | def test_preserve_modules(self, monkeypatch: MonkeyPatch) -> None:
key = [self.key + str(i) for i in range(3)]
assert not any(k in sys.modules for k in key)
for i, k in enumerate(key):
mod = ModuleType("something" + str(i))
monkeypatch.setitem(sys.modules, k, mod)
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 352 | setitem | ref | function | monkeypatch.setitem(sys.modules, k, mod)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 355 | preserve | def | function | def preserve(name):
return name in (key[0], key[1], "some-other-key")
snapshot = SysModulesSnapshot(preserve=preserve)
sys.modules[key[0]] = original[key[0]] = ModuleType("something else0")
sys.modules[key[1]] = original[key[1]] = ModuleType("something else1")
sys.mo... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 358 | SysModulesSnapshot | ref | function | snapshot = SysModulesSnapshot(preserve=preserve)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 362 | restore | ref | function | snapshot.restore()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 365 | test_preserve_container | def | function | def test_preserve_container(self, monkeypatch: MonkeyPatch) -> None:
original = dict(sys.modules)
assert self.key not in original
replacement = dict(sys.modules)
replacement[self.key] = ModuleType("life of brian")
snapshot = SysModulesSnapshot()
monkeypatch.setattr(sy... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 370 | SysModulesSnapshot | ref | function | snapshot = SysModulesSnapshot()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 372 | restore | ref | function | snapshot.restore()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 377 | parametrize | ref | function | @pytest.mark.parametrize("path_type", ("path", "meta_path"))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 378 | TestSysPathsSnapshot | def | class | path test_restore test_preserve_container |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 382 | path | def | function | def path(n: int) -> str:
return "my-dirty-little-secret-" + str(n)
def test_restore(self, monkeypatch: MonkeyPatch, path_type) -> None:
other_path_type = self.other_path[path_type]
for i in range(10):
assert self.path(i) not in getattr(sys, path_type)
sys_path = [sel... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 385 | test_restore | def | function | def test_restore(self, monkeypatch: MonkeyPatch, path_type) -> None:
other_path_type = self.other_path[path_type]
for i in range(10):
assert self.path(i) not in getattr(sys, path_type)
sys_path = [self.path(i) for i in range(6)]
monkeypatch.setattr(sys, path_type, sys_pat... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 388 | path | ref | function | assert self.path(i) not in getattr(sys, path_type)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 389 | path | ref | function | sys_path = [self.path(i) for i in range(6)]
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 393 | SysPathsSnapshot | ref | function | snapshot = SysPathsSnapshot()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 395 | path | ref | function | assert sys_path == [self.path(x) for x in transformation["source"]]
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 396 | path | ref | function | sys_path[1] = self.path(6)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 397 | path | ref | function | sys_path[3] = self.path(7)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 398 | path | ref | function | sys_path.append(self.path(8))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 400 | path | ref | function | sys_path[3:3] = [self.path(9)]
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 402 | path | ref | function | assert sys_path == [self.path(x) for x in transformation["target"]]
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 403 | restore | ref | function | snapshot.restore()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 408 | test_preserve_container | def | function | def test_preserve_container(self, monkeypatch: MonkeyPatch, path_type) -> None:
other_path_type = self.other_path[path_type]
original_data = list(getattr(sys, path_type))
original_other = getattr(sys, other_path_type)
original_other_data = list(original_other)
new: List[objec... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 414 | SysPathsSnapshot | ref | function | snapshot = SysPathsSnapshot()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 416 | restore | ref | function | snapshot.restore()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 423 | test_pytester_subprocess | def | function | def test_pytester_subprocess(pytester: Pytester) -> None:
testfile = pytester.makepyfile("def test_one(): pass")
assert pytester.runpytest_subprocess(testfile).ret == 0
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 424 | makepyfile | ref | function | testfile = pytester.makepyfile("def test_one(): pass")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 425 | runpytest_subprocess | ref | function | assert pytester.runpytest_subprocess(testfile).ret == 0
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 428 | test_pytester_subprocess_via_runpytest_arg | def | function | def test_pytester_subprocess_via_runpytest_arg(pytester: Pytester) -> None:
testfile = pytester.makepyfile(
"""
def test_pytester_subprocess(pytester):
import os
testfile = pytester.makepyfile(
\"""
import os
def test_one():
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 429 | makepyfile | ref | function | testfile = pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 443 | runpytest_inprocess | ref | function | result = pytester.runpytest_inprocess(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 449 | test_unicode_args | def | function | def test_unicode_args(pytester: Pytester) -> None:
result = pytester.runpytest("-k", "אבג")
assert result.ret == ExitCode.NO_TESTS_COLLECTED
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 450 | runpytest | ref | function | result = pytester.runpytest("-k", "אבג")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 454 | test_pytester_run_no_timeout | def | function | def test_pytester_run_no_timeout(pytester: Pytester) -> None:
testfile = pytester.makepyfile("def test_no_timeout(): pass")
assert pytester.runpytest_subprocess(testfile).ret == ExitCode.OK
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 455 | makepyfile | ref | function | testfile = pytester.makepyfile("def test_no_timeout(): pass")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 456 | runpytest_subprocess | ref | function | assert pytester.runpytest_subprocess(testfile).ret == ExitCode.OK
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 459 | test_pytester_run_with_timeout | def | function | def test_pytester_run_with_timeout(pytester: Pytester) -> None:
testfile = pytester.makepyfile("def test_no_timeout(): pass")
timeout = 120
start = time.time()
result = pytester.runpytest_subprocess(testfile, timeout=timeout)
end = time.time()
duration = end - start
assert result.ret == E... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 460 | makepyfile | ref | function | testfile = pytester.makepyfile("def test_no_timeout(): pass")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 465 | runpytest_subprocess | ref | function | result = pytester.runpytest_subprocess(testfile, timeout=timeout)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 473 | test_pytester_run_timeout_expires | def | function | def test_pytester_run_timeout_expires(pytester: Pytester) -> None:
testfile = pytester.makepyfile(
"""
import time
def test_timeout():
time.sleep(10)"""
)
with pytest.raises(pytester.TimeoutExpired):
pytester.runpytest_subprocess(testfile, timeout=1)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 474 | makepyfile | ref | function | testfile = pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 481 | raises | ref | function | with pytest.raises(pytester.TimeoutExpired):
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 482 | runpytest_subprocess | ref | function | pytester.runpytest_subprocess(testfile, timeout=1)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 485 | test_linematcher_with_nonlist | def | function | def test_linematcher_with_nonlist() -> None:
"""Test LineMatcher with regard to passing in a set (accidentally)."""
from _pytest._code.source import Source
lm = LineMatcher([])
with pytest.raises(TypeError, match="invalid type for lines2: set"):
lm.fnmatch_lines(set()) # type: ignore[arg-type]... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 489 | LineMatcher | ref | function | lm = LineMatcher([])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 490 | raises | ref | function | with pytest.raises(TypeError, match="invalid type for lines2: set"):
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pytester.py | testing/test_pytester.py | 491 | fnmatch_lines | ref | function | lm.fnmatch_lines(set()) # type: ignore[arg-type]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.