(monkeypatch, tmpdir)
| 111 | |
| 112 | |
| 113 | def 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 | |
| 133 | def test_intree_extensions_package_dir(monkeypatch, tmpdir): |
nothing calls this directly
no test coverage detected