MCPcopy Create free account
hub / github.com/pybind/pybind11 / test_intree_extensions

Function test_intree_extensions

tests/extra_setuptools/test_setuphelper.py:113–130  ·  view source on GitHub ↗
(monkeypatch, tmpdir)

Source from the content-addressed store, hash-verified

111
112
113def test_intree_extensions(monkeypatch, tmpdir):
114 monkeypatch.syspath_prepend(MAIN_DIR)
115
116 from pybind11.setup_helpers import intree_extensions
117
118 monkeypatch.chdir(tmpdir)
119 root = tmpdir
120 root.ensure_dir()
121 subdir = root / "dir"
122 subdir.ensure_dir()
123 src = subdir / "ext.cpp"
124 src.ensure()
125 relpath = src.relto(tmpdir)
126 (ext,) = intree_extensions([relpath])
127 assert ext.name == "ext"
128 subdir.ensure("__init__.py")
129 (ext,) = intree_extensions([relpath])
130 assert ext.name == "dir.ext"
131
132
133def test_intree_extensions_package_dir(monkeypatch, tmpdir):

Callers

nothing calls this directly

Calls 2

intree_extensionsFunction · 0.90
ensureMethod · 0.80

Tested by

no test coverage detected