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_pastebin.py | testing/test_pastebin.py | 85 | TestPaste | def | class | pastebin mocked_urlopen_fail mocked_urlopen_invalid mocked_urlopen test_pastebin_invalid_url test_pastebin_http_error test_create_new_paste test_create_new_paste_failure |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 87 | pastebin | def | function | def pastebin(self, request):
return request.config.pluginmanager.getplugin("pastebin")
@pytest.fixture
def mocked_urlopen_fail(self, monkeypatch: MonkeyPatch):
"""Monkeypatch the actual urlopen call to emulate a HTTP Error 400."""
calls = []
import urllib.error
impo... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 88 | getplugin | ref | function | return request.config.pluginmanager.getplugin("pastebin")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 91 | mocked_urlopen_fail | def | function | def mocked_urlopen_fail(self, monkeypatch: MonkeyPatch):
"""Monkeypatch the actual urlopen call to emulate a HTTP Error 400."""
calls = []
import urllib.error
import urllib.request
def mocked(url, data):
calls.append((url, data))
raise urllib.error.H... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 98 | mocked | def | function | def mocked(url, data):
calls.append((url, data))
raise urllib.error.HTTPError(url, 400, "Bad request", {}, io.BytesIO())
monkeypatch.setattr(urllib.request, "urlopen", mocked)
return calls
@pytest.fixture
def mocked_urlopen_invalid(self, monkeypatch: MonkeyPatch... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 106 | mocked_urlopen_invalid | def | function | def mocked_urlopen_invalid(self, monkeypatch: MonkeyPatch):
"""Monkeypatch the actual urlopen calls done by the internal plugin
function that connects to bpaste service, but return a url in an
unexpected format."""
calls = []
def mocked(url, data):
calls.append((... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 112 | mocked | def | function | def mocked(url, data):
calls.append((url, data))
raise urllib.error.HTTPError(url, 400, "Bad request", {}, io.BytesIO())
monkeypatch.setattr(urllib.request, "urlopen", mocked)
return calls
@pytest.fixture
def mocked_urlopen_invalid(self, monkeypatch: MonkeyPatch... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 115 | DummyFile | def | class | read read |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 116 | read | def | function | def read(self):
# part of html of a normal response
return b'View <a href="/invalid/3c0c6750bd">raw</a>.'
return DummyFile()
import urllib.request
monkeypatch.setattr(urllib.request, "urlopen", mocked)
return calls
@pyte... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 120 | DummyFile | ref | function | return DummyFile()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 128 | mocked_urlopen | def | function | def mocked_urlopen(self, monkeypatch: MonkeyPatch):
"""Monkeypatch the actual urlopen calls done by the internal plugin
function that connects to bpaste service."""
calls = []
def mocked(url, data):
calls.append((url, data))
class DummyFile:
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 133 | mocked | def | function | def mocked(url, data):
calls.append((url, data))
raise urllib.error.HTTPError(url, 400, "Bad request", {}, io.BytesIO())
monkeypatch.setattr(urllib.request, "urlopen", mocked)
return calls
@pytest.fixture
def mocked_urlopen_invalid(self, monkeypatch: MonkeyPatch... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 136 | DummyFile | def | class | read read |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 137 | read | def | function | def read(self):
# part of html of a normal response
return b'View <a href="/invalid/3c0c6750bd">raw</a>.'
return DummyFile()
import urllib.request
monkeypatch.setattr(urllib.request, "urlopen", mocked)
return calls
@pyte... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 141 | DummyFile | ref | function | return DummyFile()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 148 | test_pastebin_invalid_url | def | function | def test_pastebin_invalid_url(self, pastebin, mocked_urlopen_invalid) -> None:
result = pastebin.create_new_paste(b"full-paste-contents")
assert (
result
== "bad response: invalid format ('View <a href=\"/invalid/3c0c6750bd\">raw</a>.')"
)
assert len(mocked_ur... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 149 | create_new_paste | ref | function | result = pastebin.create_new_paste(b"full-paste-contents")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 156 | test_pastebin_http_error | def | function | def test_pastebin_http_error(self, pastebin, mocked_urlopen_fail) -> None:
result = pastebin.create_new_paste(b"full-paste-contents")
assert result == "bad response: HTTP Error 400: Bad request"
assert len(mocked_urlopen_fail) == 1
def test_create_new_paste(self, pastebin, mocked_urlope... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 157 | create_new_paste | ref | function | result = pastebin.create_new_paste(b"full-paste-contents")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 161 | test_create_new_paste | def | function | def test_create_new_paste(self, pastebin, mocked_urlopen) -> None:
result = pastebin.create_new_paste(b"full-paste-contents")
assert result == "https://bpa.st/show/3c0c6750bd"
assert len(mocked_urlopen) == 1
url, data = mocked_urlopen[0]
assert type(data) is bytes
lex... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 162 | create_new_paste | ref | function | result = pastebin.create_new_paste(b"full-paste-contents")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 169 | decode | ref | function | assert "lexer=%s" % lexer in data.decode()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 170 | decode | ref | function | assert "code=full-paste-contents" in data.decode()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 171 | decode | ref | function | assert "expiry=1week" in data.decode()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 173 | test_create_new_paste_failure | def | function | def test_create_new_paste_failure(self, pastebin, monkeypatch: MonkeyPatch) -> None:
import io
import urllib.request
def response(url, data):
stream = io.BytesIO(b"something bad occurred")
return stream
monkeypatch.setattr(urllib.request, "urlopen", response... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 177 | response | def | function | def response(url, data):
stream = io.BytesIO(b"something bad occurred")
return stream
monkeypatch.setattr(urllib.request, "urlopen", response)
result = pastebin.create_new_paste(b"full-paste-contents")
assert result == "bad response: invalid format ('something ba... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pastebin.py | testing/test_pastebin.py | 182 | create_new_paste | ref | function | result = pastebin.create_new_paste(b"full-paste-contents")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 29 | TestFNMatcherPort | def | class | test_matching test_matching_abspath test_not_matching |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 39 | parametrize | ref | function | @pytest.mark.parametrize(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 53 | test_matching | def | function | def test_matching(self, pattern: str, path: str) -> None:
assert fnmatch_ex(pattern, path)
def test_matching_abspath(self) -> None:
abspath = os.path.abspath(os.path.join("tests/foo.py"))
assert fnmatch_ex("tests/foo.py", abspath)
@pytest.mark.parametrize(
"pattern, path",
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 54 | fnmatch_ex | ref | function | assert fnmatch_ex(pattern, path)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 56 | test_matching_abspath | def | function | def test_matching_abspath(self) -> None:
abspath = os.path.abspath(os.path.join("tests/foo.py"))
assert fnmatch_ex("tests/foo.py", abspath)
@pytest.mark.parametrize(
"pattern, path",
[
("*.py", "foo.pyc"),
("*.py", "foo/foo.pyc"),
("tests/*.py... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 58 | fnmatch_ex | ref | function | assert fnmatch_ex("tests/foo.py", abspath)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 60 | parametrize | ref | function | @pytest.mark.parametrize(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 74 | test_not_matching | def | function | def test_not_matching(self, pattern: str, path: str) -> None:
assert not fnmatch_ex(pattern, path)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 75 | fnmatch_ex | ref | function | assert not fnmatch_ex(pattern, path)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 78 | TestImportPath | def | class | path1 setuptestfs test_smoke_test test_renamed_dir_creates_mismatch test_messy_name test_dir test_a test_b test_c test_d test_import_after test_check_filepath_consistency test_issue131_on__init__ test_ensuresyspath_append test_invalid_path simple_module test_importmode_importlib test_importmode_twice_is_different_modul... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 86 | fixture | ref | function | @pytest.fixture(scope="session")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 87 | path1 | def | function | def path1(self, tmp_path_factory: TempPathFactory) -> Generator[Path, None, None]:
path = tmp_path_factory.mktemp("path")
self.setuptestfs(path)
yield path
assert path.joinpath("samplefile").exists()
def setuptestfs(self, path: Path) -> None:
# print "setting up test fs ... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 88 | mktemp | ref | function | path = tmp_path_factory.mktemp("path")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 89 | setuptestfs | ref | function | self.setuptestfs(path)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 91 | joinpath | ref | function | assert path.joinpath("samplefile").exists()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 93 | setuptestfs | def | function | def setuptestfs(self, path: Path) -> None:
# print "setting up test fs for", repr(path)
samplefile = path / "samplefile"
samplefile.write_text("samplefile\n")
execfile = path / "execfile"
execfile.write_text("x=42")
execfilepy = path / "execfile.py"
execfile... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 96 | write_text | ref | function | samplefile.write_text("samplefile\n")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 99 | write_text | ref | function | execfile.write_text("x=42")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 102 | write_text | ref | function | execfilepy.write_text("x=42")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 105 | joinpath | ref | function | path.joinpath("samplepickle").write_bytes(pickle.dumps(d, 1))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 105 | write_bytes | ref | function | path.joinpath("samplepickle").write_bytes(pickle.dumps(d, 1))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 108 | mkdir | ref | function | sampledir.mkdir()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 109 | joinpath | ref | function | sampledir.joinpath("otherfile").touch()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 109 | touch | ref | function | sampledir.joinpath("otherfile").touch()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 112 | mkdir | ref | function | otherdir.mkdir()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 113 | joinpath | ref | function | otherdir.joinpath("__init__.py").touch()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 113 | touch | ref | function | otherdir.joinpath("__init__.py").touch()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 116 | write_text | ref | function | module_a.write_text("from .b import stuff as result\n")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 118 | write_text | ref | function | module_b.write_text('stuff="got it"\n')
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 120 | write_text | ref | function | module_c.write_text(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 130 | write_text | ref | function | module_d.write_text(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 140 | test_smoke_test | def | function | def test_smoke_test(self, path1: Path) -> None:
obj = import_path(path1 / "execfile.py", root=path1)
assert obj.x == 42 # type: ignore[attr-defined]
assert obj.__name__ == "execfile"
def test_renamed_dir_creates_mismatch(
self, tmp_path: Path, monkeypatch: MonkeyPatch
) -> ... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 141 | import_path | ref | function | obj = import_path(path1 / "execfile.py", root=path1)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 145 | test_renamed_dir_creates_mismatch | def | function | def test_renamed_dir_creates_mismatch(
self, tmp_path: Path, monkeypatch: MonkeyPatch
) -> None:
tmp_path.joinpath("a").mkdir()
p = tmp_path.joinpath("a", "test_x123.py")
p.touch()
import_path(p, root=tmp_path)
tmp_path.joinpath("a").rename(tmp_path.joinpath("b"))... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 148 | joinpath | ref | function | tmp_path.joinpath("a").mkdir()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 148 | mkdir | ref | function | tmp_path.joinpath("a").mkdir()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 149 | joinpath | ref | function | p = tmp_path.joinpath("a", "test_x123.py")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 150 | touch | ref | function | p.touch()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 151 | import_path | ref | function | import_path(p, root=tmp_path)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 152 | joinpath | ref | function | tmp_path.joinpath("a").rename(tmp_path.joinpath("b"))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 152 | rename | ref | function | tmp_path.joinpath("a").rename(tmp_path.joinpath("b"))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 152 | joinpath | ref | function | tmp_path.joinpath("a").rename(tmp_path.joinpath("b"))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 153 | raises | ref | function | with pytest.raises(ImportPathMismatchError):
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 154 | import_path | ref | function | import_path(tmp_path.joinpath("b", "test_x123.py"), root=tmp_path)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 154 | joinpath | ref | function | import_path(tmp_path.joinpath("b", "test_x123.py"), root=tmp_path)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 157 | setenv | ref | function | monkeypatch.setenv("PY_IGNORE_IMPORTMISMATCH", "1")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 158 | import_path | ref | function | import_path(tmp_path.joinpath("b", "test_x123.py"), root=tmp_path)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 158 | joinpath | ref | function | import_path(tmp_path.joinpath("b", "test_x123.py"), root=tmp_path)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 161 | setenv | ref | function | monkeypatch.setenv("PY_IGNORE_IMPORTMISMATCH", "0")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 162 | raises | ref | function | with pytest.raises(ImportPathMismatchError):
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 163 | import_path | ref | function | import_path(tmp_path.joinpath("b", "test_x123.py"), root=tmp_path)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 163 | joinpath | ref | function | import_path(tmp_path.joinpath("b", "test_x123.py"), root=tmp_path)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 165 | test_messy_name | def | function | def test_messy_name(self, tmp_path: Path) -> None:
# https://bitbucket.org/hpk42/py-trunk/issue/129
path = tmp_path / "foo__init__.py"
path.touch()
module = import_path(path, root=tmp_path)
assert module.__name__ == "foo__init__"
def test_dir(self, tmp_path: Path) -> Non... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 168 | touch | ref | function | path.touch()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 169 | import_path | ref | function | module = import_path(path, root=tmp_path)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 172 | test_dir | def | function | def test_dir(self, tmp_path: Path) -> None:
p = tmp_path / "hello_123"
p.mkdir()
p_init = p / "__init__.py"
p_init.touch()
m = import_path(p, root=tmp_path)
assert m.__name__ == "hello_123"
m = import_path(p_init, root=tmp_path)
assert m.__name__ == "h... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 174 | mkdir | ref | function | p.mkdir()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 176 | touch | ref | function | p_init.touch()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 177 | import_path | ref | function | m = import_path(p, root=tmp_path)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 179 | import_path | ref | function | m = import_path(p_init, root=tmp_path)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 182 | test_a | def | function | def test_a(self, path1: Path) -> None:
otherdir = path1 / "otherdir"
mod = import_path(otherdir / "a.py", root=path1)
assert mod.result == "got it" # type: ignore[attr-defined]
assert mod.__name__ == "otherdir.a"
def test_b(self, path1: Path) -> None:
otherdir = path1 /... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 184 | import_path | ref | function | mod = import_path(otherdir / "a.py", root=path1)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 188 | test_b | def | function | def test_b(self, path1: Path) -> None:
otherdir = path1 / "otherdir"
mod = import_path(otherdir / "b.py", root=path1)
assert mod.stuff == "got it" # type: ignore[attr-defined]
assert mod.__name__ == "otherdir.b"
def test_c(self, path1: Path) -> None:
otherdir = path1 / ... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 190 | import_path | ref | function | mod = import_path(otherdir / "b.py", root=path1)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 194 | test_c | def | function | def test_c(self, path1: Path) -> None:
otherdir = path1 / "otherdir"
mod = import_path(otherdir / "c.py", root=path1)
assert mod.value == "got it" # type: ignore[attr-defined]
def test_d(self, path1: Path) -> None:
otherdir = path1 / "otherdir"
mod = import_path(otherdi... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 196 | import_path | ref | function | mod = import_path(otherdir / "c.py", root=path1)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 199 | test_d | def | function | def test_d(self, path1: Path) -> None:
otherdir = path1 / "otherdir"
mod = import_path(otherdir / "d.py", root=path1)
assert mod.value2 == "got it" # type: ignore[attr-defined]
def test_import_after(self, tmp_path: Path) -> None:
tmp_path.joinpath("xxxpackage").mkdir()
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 201 | import_path | ref | function | mod = import_path(otherdir / "d.py", root=path1)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 204 | test_import_after | def | function | def test_import_after(self, tmp_path: Path) -> None:
tmp_path.joinpath("xxxpackage").mkdir()
tmp_path.joinpath("xxxpackage", "__init__.py").touch()
mod1path = tmp_path.joinpath("xxxpackage", "module1.py")
mod1path.touch()
mod1 = import_path(mod1path, root=tmp_path)
as... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 205 | joinpath | ref | function | tmp_path.joinpath("xxxpackage").mkdir()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 205 | mkdir | ref | function | tmp_path.joinpath("xxxpackage").mkdir()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 206 | joinpath | ref | function | tmp_path.joinpath("xxxpackage", "__init__.py").touch()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/test_pathlib.py | testing/test_pathlib.py | 206 | touch | ref | function | tmp_path.joinpath("xxxpackage", "__init__.py").touch()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.