Test building a third-party C extension with the limited API.
(tmp_path)
| 17 | ), |
| 18 | ) |
| 19 | def test_limited_api(tmp_path): |
| 20 | """Test building a third-party C extension with the limited API.""" |
| 21 | # Based in part on test_cython from random.tests.test_extending |
| 22 | |
| 23 | here = os.path.dirname(__file__) |
| 24 | ext_dir = os.path.join(here, "examples", "limited_api") |
| 25 | |
| 26 | cytest = str(tmp_path / "limited_api") |
| 27 | |
| 28 | shutil.copytree(ext_dir, cytest) |
| 29 | # build the examples and "install" them into a temporary directory |
| 30 | |
| 31 | install_log = str(tmp_path / "tmp_install_log.txt") |
| 32 | subprocess.check_output( |
| 33 | [ |
| 34 | sys.executable, |
| 35 | "setup.py", |
| 36 | "build", |
| 37 | "install", |
| 38 | "--prefix", str(tmp_path / "installdir"), |
| 39 | "--single-version-externally-managed", |
| 40 | "--record", |
| 41 | install_log, |
| 42 | ], |
| 43 | cwd=cytest, |
| 44 | ) |
nothing calls this directly
no test coverage detected