(tmp_path)
| 283 | |
| 284 | |
| 285 | def test_language_versioned_python_hook(tmp_path): |
| 286 | setup_py = '''\ |
| 287 | from setuptools import setup |
| 288 | setup( |
| 289 | name='example', |
| 290 | py_modules=['mod'], |
| 291 | entry_points={'console_scripts': ['myexe=mod:main']}, |
| 292 | ) |
| 293 | ''' |
| 294 | tmp_path.joinpath('setup.py').write_text(setup_py) |
| 295 | tmp_path.joinpath('mod.py').write_text('def main(): print("ohai")') |
| 296 | |
| 297 | # we patch this to force virtualenv executing with `-p` since we can't |
| 298 | # reliably have multiple pythons available in CI |
| 299 | with mock.patch.object( |
| 300 | python, |
| 301 | '_sys_executable_matches', |
| 302 | return_value=False, |
| 303 | ): |
| 304 | assert run_language(tmp_path, python, 'myexe') == (0, b'ohai\n') |
| 305 | |
| 306 | |
| 307 | def _make_hello_hello(tmp_path): |
nothing calls this directly
no test coverage detected