MCPcopy
hub / github.com/pytest-dev/pytest / test_pyimport_and_import

Method test_pyimport_and_import

testing/_py/test_local.py:1071–1078  ·  testing/_py/test_local.py::TestImport.test_pyimport_and_import
(self, tmpdir)

Source from the content-addressed store, hash-verified

1069 assert mod.value2 == class="st">"got it"
1070
1071 def test_pyimport_and_import(self, tmpdir):
1072 tmpdir.ensure(class="st">"xxxpackage", class="st">"__init__.py")
1073 mod1path = tmpdir.ensure(class="st">"xxxpackage", class="st">"module1.py")
1074 mod1 = mod1path.pyimport()
1075 assert mod1.__name__ == class="st">"xxxpackage.module1"
1076 from xxxpackage import module1
1077
1078 assert module1 is mod1
1079
1080 def test_pyimport_check_filepath_consistency(self, monkeypatch, tmpdir):
1081 name = class="st">"pointsback123"

Callers

nothing calls this directly

Calls 2

ensureMethod · 0.80
pyimportMethod · 0.80

Tested by

no test coverage detected