bpo-35967: Make test_platform.test_uname_processor more lenient to satisfy build bots. (GH-19544)

* bpo-35967: Make test more lenient to satisfy build bots.

* Update Lib/test/test_platform.py

Co-Authored-By: Kyle Stanley <aeros167@gmail.com>

* Expect '' for 'unknown'

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
This commit is contained in:
Jason R. Coombs 2020-04-15 19:55:35 -04:00 committed by GitHub
parent 58d6f2ee3a
commit e72cbcb346
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -169,10 +169,12 @@ class PlatformTest(unittest.TestCase):
of 'uname -p'. See Issue 35967 for rationale.
"""
with contextlib.suppress(subprocess.CalledProcessError):
self.assertEqual(
platform.uname().processor,
subprocess.check_output(['uname', '-p'], text=True).strip(),
)
expect = subprocess.check_output(['uname', '-p'], text=True).strip()
if expect == 'unknown':
expect = ''
self.assertEqual(platform.uname().processor, expect)
@unittest.skipUnless(sys.platform.startswith('win'), "windows only test")
def test_uname_win32_ARCHITEW6432(self):