(tmpdir)
| 363 | |
| 364 | |
| 365 | def test_entry_point_exit_code(tmpdir): |
| 366 | # type: (Any) -> None |
| 367 | setup_py = dedent( |
| 368 | """ |
| 369 | from setuptools import setup |
| 370 | |
| 371 | setup( |
| 372 | name='my_app', |
| 373 | version='0.0.0', |
| 374 | zip_safe=True, |
| 375 | packages=[''], |
| 376 | entry_points={'console_scripts': ['my_app = my_app:do_something']}, |
| 377 | ) |
| 378 | """ |
| 379 | ) |
| 380 | |
| 381 | error_msg = "setuptools expects this to exit non-zero" |
| 382 | |
| 383 | my_app = dedent( |
| 384 | """ |
| 385 | def do_something(): |
| 386 | return '%s' |
| 387 | """ |
| 388 | % error_msg |
| 389 | ) |
| 390 | |
| 391 | with temporary_content({"setup.py": setup_py, "my_app.py": my_app}) as project_dir: |
| 392 | my_app_pex = os.path.join(str(tmpdir), "my_app.pex") |
| 393 | run_pex_command(args=[project_dir, "-o", my_app_pex]).assert_success() |
| 394 | so, rc = run_simple_pex(my_app_pex, env=make_env(PEX_SCRIPT="my_app")) |
| 395 | assert so.decode("utf-8").strip() == error_msg |
| 396 | assert rc == 1 |
| 397 | |
| 398 | |
| 399 | CI_multi_resolve_test = pytest.mark.skipif( |
nothing calls this directly
no test coverage detected