From 61a20d30d574560b253f739f8810742daf631919 Mon Sep 17 00:00:00 2001 From: John Sirois Date: Fri, 19 Oct 2018 08:50:53 -0700 Subject: [PATCH] Fix *_custom_setuptools_useable ITs. Ensure the entrypoint function used to test both entrypoints and modules explicitly tests that its the import that works and then chains the appropriate return / __main__ behavior to express the result of the test. --- tests/test_integration.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/test_integration.py b/tests/test_integration.py index 36bee7ac5..6be82d121 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -1022,13 +1022,17 @@ def pex_with_entrypoints(entry_point): """) my_app = dedent(""" - from setuptools.sandbox import run_setup + import sys def do_something(): - return run_setup + try: + from setuptools.sandbox import run_setup + return 0 + except: + return 1 if __name__ == '__main__': - do_something() + sys.exit(do_something()) """) with temporary_content({'setup.py': setup_py, 'my_app.py': my_app}) as project_dir: