diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2022-04-29 19:34:38 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2022-04-29 19:34:38 -0400 |
| commit | 57903582af9c1eb7dec150f25fea3bc196932a0a (patch) | |
| tree | 435cc2dac4154313f22d7d9615cb6e11378c534f | |
| parent | 66667745c67d5d68247cbe17b00620424672e144 (diff) | |
| download | python-setuptools-git-57903582af9c1eb7dec150f25fea3bc196932a0a.tar.gz | |
Simply emit the expected value instead of converting to an exit code and deciphering.
| -rw-r--r-- | distutils/tests/test_sysconfig.py | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/distutils/tests/test_sysconfig.py b/distutils/tests/test_sysconfig.py index 973d4574..70b7ad19 100644 --- a/distutils/tests/test_sysconfig.py +++ b/distutils/tests/test_sysconfig.py @@ -325,20 +325,14 @@ class SysconfigTestCase(support.EnvironGuard, unittest.TestCase): rf".\{TESTFN}", "--without-pip", ] subprocess.check_output(cmd) - try: - distutils_path = os.path.dirname(os.path.dirname(sysconfig.__file__)) - cmd = [ - rf".\{TESTFN}\Scripts\python.exe", - "-c", - "import distutils.sysconfig as s, sys; sys.exit(0 if s.python_build else 3456)" - ] - subprocess.check_output(cmd, env={**os.environ, "PYTHONPATH": distutils_path}) - except subprocess.CalledProcessError as ex: - # Return code doesn't matter, provided it's unlikely to be confused with - # a different kind of error - if ex.returncode != 3456: - raise - self.fail("expected distutils.sysconfig.python_build == True; got False") + distutils_path = os.path.dirname(os.path.dirname(sysconfig.__file__)) + cmd = [ + rf".\{TESTFN}\Scripts\python.exe", + "-c", + "import distutils.sysconfig; print(distutils.sysconfig.python_build)" + ] + out = subprocess.check_output(cmd, env={**os.environ, "PYTHONPATH": distutils_path}) + assert out == "True" def test_suite(): |
