summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_platform.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-42163, bpo-42189, bpo-42659: Support uname_tuple._replace (for all but ↵Jason R. Coombs2020-12-311-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | processor) (#23010) * Add test capturing missed expectation with uname_result._replace. * bpo-42163: Override uname_result._make to allow uname_result._replace to work (for everything but 'processor'. * Replace hard-coded length with one derived from the definition. * Add test capturing missed expectation with copy/deepcopy on namedtuple (bpo-42189). * bpo-42189: Exclude processor parameter when constructing uname_result. * In _make, rely on __new__ to strip processor. * Add blurb. * iter is not necessary here. * Rely on num_fields in __new__ * Add test for slices on uname * Add test for copy and pickle. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> * import pickle * Fix equality test after pickling. * Simply rely on __reduce__ for pickling. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-28468: Add platform.freedesktop_os_release() (GH-23492)Christian Heimes2020-11-301-0/+106
| | | | | | | Add platform.freedesktop_os_release() function to parse freedesktop.org os-release files. Signed-off-by: Christian Heimes <christian@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-41100: in test_platform, ignore 10.16 (GH-23485)Ned Deily2020-11-241-1/+4
|
* bpo-41100: Support macOS 11 and Apple Silicon (GH-22855)Ronald Oussoren2020-11-081-1/+1
| | | | | | | | | | | Co-authored-by: Lawrence D’Anna <lawrence_danna@apple.com> * Add support for macOS 11 and Apple Silicon (aka arm64) As a side effect of this work use the system copy of libffi on macOS, and remove the vendored copy * Support building on recent versions of macOS while deploying to older versions This allows building installers on macOS 11 while still supporting macOS 10.9.
* bpo-40275: Use new test.support helper submodules in tests (GH-21764)Hai Shi2020-08-071-1/+1
|
* bpo-40275: Use new test.support helper submodules in tests (GH-20849)Hai Shi2020-06-251-3/+4
|
* bpo-40570: Improve compatibility of uname_result with late-bound .platform ↵Jason R. Coombs2020-05-091-0/+15
| | | | | | | (#20015) * bpo-40570: Improve compatibility of uname_result with late-bound .platform. * Add test capturing ability to cast uname to a tuple.
* bpo-40443: Remove unused imports in tests (GH-19805)Victor Stinner2020-04-291-1/+0
|
* bpo-35967: Skip test with `uname -p` on Android (GH-19577)Chih-Hsuan Yen2020-04-181-2/+5
| | | | | | | | | | | | | | | | | | | The uname binary on Android does not support -p [1]. Here is a sample log: ``` 0:06:03 load avg: 0.56 [254/421/8] test_platform failed -- running: test_asyncio (5 min 53 sec) uname: Unknown option p (see "uname --help") test test_platform failed -- Traceback (most recent call last): File "/data/local/tmp/lib/python3.9/test/test_platform.py", line 170, in test_uname_processor proc_res = subprocess.check_output(['uname', '-p'], text=True).strip() File "/data/local/tmp/lib/python3.9/subprocess.py", line 420, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/data/local/tmp/lib/python3.9/subprocess.py", line 524, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['uname', '-p']' returned non-zero exit status 1. ``` [1] https://android.googlesource.com/platform/external/toybox/+/refs/heads/master/toys/posix/uname.c Automerge-Triggered-By: @jaraco
* bpo-35967 resolve platform.processor late (GH-12239)Jason R. Coombs2020-04-161-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Replace flag-flip indirection with direct inspection * Use any for simpler code * Avoid flag flip and set results directly. * Resolve processor in a single function. * Extract processor handling into a namespace (class) * Remove _syscmd_uname, unused * Restore platform.processor behavior to match prior expectation (reliant on uname -p in a subprocess). * Extract '_unknown_as_blank' function. * Override uname_result to resolve the processor late. * Add a test intended to capture the expected values from 'uname -p' * Instead of trying to keep track of all of the possible outputs on different systems (probably a fool's errand), simply assert that except for the known platform variance, uname().processor matches the output of 'uname -p' * Use a skipIf directive * Use contextlib.suppress to suppress the error. Inline strip call. * 📜🤖 Added by blurb_it. * Remove use of contextlib.suppress (it would fail with NameError if it had any effect). Rely on _unknown_as_blank to replace unknown with blank. Co-authored-by: blurb-it[bot] <blurb-it[bot]@users.noreply.github.com>
* bpo-35967: Make test_platform.test_uname_processor more lenient to satisfy ↵Jason R. Coombs2020-04-151-4/+6
| | | | | | | | | | | | | 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>
* bpo-35967: Baseline values for uname -p (GH-12824)Jason R. Coombs2020-04-151-0/+14
| | | | | | | | | * Add a test intended to capture the expected values from 'uname -p' * Instead of trying to keep track of all of the possible outputs on different systems (probably a fool's errand), simply assert that except for the known platform variance, uname().processor matches the output of 'uname -p' * Use a skipIf directive * Use contextlib.suppress to suppress the error. Inline strip call.
* bpo-40094: Add test.support.wait_process() (GH-19254)Victor Stinner2020-03-311-3/+1
| | | | | | | | | Moreover, the following tests now check the child process exit code: * test_os.PtyTests * test_mailbox.test_lock_conflict() * test_tempfile.test_process_awareness() * test_uuid.testIssue8621() * multiprocessing resource tracker tests
* Remove unused imports in tests (GH-14518)Victor Stinner2019-07-011-2/+1
|
* bpo-37369: Fix initialization of sys members when launched via an app ↵Steve Dower2019-06-291-31/+8
| | | | | | | container (GH-14428) sys._base_executable is now always defined on all platforms, and can be overridden through configuration. Also adds test.support.PythonSymlink to encapsulate platform-specific logic for symlinking sys.executable
* bpo-35346, platform: replace os.popen() with subprocess (GH-10786)Victor Stinner2018-12-071-9/+9
| | | | | | | | | | | Replace os.popen() with subprocess.check_output() in the platform module: * platform.uname() (its _syscmd_ver() helper function) now redirects stderr to DEVNULL. * Remove platform.DEV_NULL. * _syscmd_uname() and _syscmd_file() no longer catch AttributeError. The "except AttributeError:" was only needed in Python 2, when os.popen() was not always available. In Python 3, subprocess.check_output() is always available.
* bpo-35344: platform.platform() uses mac_ver() on macOS (GH-10780)Victor Stinner2018-12-051-0/+33
| | | | | On macOS, platform.platform() now uses mac_ver(), if it returns a non-empty release string, to get the macOS version rather than darwin version.
* bpo-35389: platform.libc_ver() uses os.confstr() (GH-10891)Victor Stinner2018-12-051-6/+35
| | | | | | | | | | platform.libc_ver() now uses os.confstr('CS_GNU_LIBC_VERSION') if available and the *executable* parameter is not set. The default value of the libc_ver() *executable* parameter becomes None. Quick benchmark on Fedora 29: python3 -m perf command ./python -S -c 'import platform; platform.libc_ver()' 94.9 ms +- 4.3 ms -> 33.2 ms +- 1.4 ms: 2.86x faster (-65%)
* bpo-35345: Remove platform.popen() (GH-10781)Victor Stinner2018-11-291-33/+0
| | | | | | | Remove platform.popen() function, it was deprecated since Python 3.3: use os.popen() instead. Rename also the "Removed" section to "API and Feature Removals" of What's New in Python 3.8.
* bpo-35202: Remove unused imports in tests. (GH-10561)Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి)2018-11-161-1/+0
|
* bpo-34011: Fixes missing venv files and other tests (GH-9458)Steve Dower2018-09-201-15/+21
|
* bpo-26544: Add test for platform._comparable_version(). (GH-8973)Serhiy Storchaka2018-09-041-0/+36
|
* bpo-26544: Fixed implementation of platform.libc_ver(). (GH-7684)Serhiy Storchaka2018-07-091-1/+7
|
* Revert "bpo-33671: Add support.MS_WINDOWS and support.MACOS (GH-7800)" (GH-7919)Victor Stinner2018-06-261-2/+4
| | | This reverts commit 8fbbdf0c3107c3052659e166f73990b466eacbb0.
* bpo-33671: Add support.MS_WINDOWS and support.MACOS (GH-7800)Victor Stinner2018-06-221-4/+2
| | | | | | | | * Add support.MS_WINDOWS: True if Python is running on Microsoft Windows. * Add support.MACOS: True if Python is running on Apple macOS. * Replace support.is_android with support.ANDROID * Replace support.is_jython with support.JYTHON * Cleanup code to initialize unix_shell
* bpo-28167: Remove platform.linux_distribution (GH-6871)Petr Viktorin2018-05-161-65/+0
| | | | | | | | * test_ssl: Remove skip_if_broken_ubuntu_ssl We no longer support OpenSSL 0.9.8.15.15. * bpo-28167: Remove platform.linux_distribution
* bpo-28167: bump platform.linux_distribution removal to 3.8 (GH-6669)Matthias Bussonnier2018-05-151-2/+2
| | | | | Also bump PendingDeprecationWarning to DeprecationWarning.
* bpo-32159: Remove tools for CVS and Subversion (#4615)Victor Stinner2017-11-281-3/+3
| | | | | | | | | | CPython migrated from CVS to Subversion, to Mercurial, and then to Git. CVS and Subversion are not more used to develop CPython. * platform module: drop support for sys.subversion. The sys.subversion attribute has been removed in Python 3.3. * Remove Misc/svnmap.txt * Remove Tools/scripts/svneol.py * Remove Tools/scripts/treesync.py
* bpo-27593: Get SCM build info from git instead of hg. (#446)Ned Deily2017-03-041-6/+6
| | | | | | | sys.version and the platform module python_build(), python_branch(), and python_revision() functions now use git information rather than hg when building from a repo. Based on original patches by Brett Cannon and Steve Dower.
* Closes #28059: Fixes test_platform to set PYTHONPATH for .pyd filesSteve Dower2016-09-101-2/+3
|\
| * Closes #28059: Fixes test_platform to set PYTHONPATH for .pyd filesSteve Dower2016-09-101-2/+9
| |
* | test_platform: Save/restore os.environ on WindowsVictor Stinner2016-09-101-0/+7
| |
* | #27364: fix "incorrect" uses of escape character in the stdlib.R David Murray2016-09-081-2/+2
|/ | | | | | | And most of the tools. Patch by Emanual Barry, reviewed by me, Serhiy Storchaka, and Martin Panter.
* Issue #21313: Tolerate truncated buildinfo in sys.versionMartin Panter2016-06-081-0/+16
|
* Issue #26041: Remove "will be removed in Python 3.7" from description messagesBerker Peksag2016-04-241-4/+2
| | | | | | | We will keep platform.dist() and platform.linux_distribution() to make porting from Python 2 easier. Patch by Kumaripaba Miyurusara Athukorala.
* Issue #24210: Silence more PendingDeprecationWarning warnings in tests.Berker Peksag2015-05-161-2/+16
|
* Issue #1322: platform.dist() and platform.linux_distribution() functions are ↵Berker Peksag2015-05-131-5/+19
| | | | | | now deprecated. Initial patch by Vajrasky Kok.
* - Issue #21539: Add a *exists_ok* argument to `Pathlib.mkdir()` to mimicBarry Warsaw2014-08-051-1/+1
| | | | | | | | | | | `mkdir -p` and `os.makedirs()` functionality. When true, ignore FileExistsErrors. Patch by Berker Peksag. (With minor cleanups, additional tests, doc tweaks, etc. by Barry) Also: * Remove some unused imports in test_pathlib.py reported by pyflakes.
* Issue #17429: Oops, remove unused importVictor Stinner2013-12-081-1/+0
|
* Issue #17429: platform.linux_distribution() now decodes files from the UTF-8Victor Stinner2013-12-081-0/+16
| | | | | | | encoding with the surrogateescape error handler, instead of decoding from the locale encoding in strict mode. It fixes the function on Fedora 19 which is probably the first major distribution release with a non-ASCII name. Patch written by Toshio Kuratomi.
* #8964: fix platform._sys_version to handle IronPython 2.6+.Ezio Melotti2013-10-211-0/+13
|
* Issue #15164: Change return value of platform.uname() from aLarry Hastings2012-06-241-1/+7
| | | | plain tuple to a collections.namedtuple.
* Issue #12549: Correct test_platform to not fail when OS X returns 'x86_64'Ned Deily2011-07-131-1/+1
|\ | | | | | | as the processor type on some Mac systems.
| * Issue #12549: Correct test_platform to not fail when OS X returns 'x86_64'Ned Deily2011-07-131-1/+1
| | | | | | | | | | as the processor type on some Mac systems. Also fix NameError in fallback _mac_ver_gestalt function. And remove out-of-date URL in docs.
* | test_platform: ignore DeprecationWarning on popen() testVictor Stinner2011-06-101-15/+20
| |
* | Remove sys.subversion and svn build identification leftovers.Georg Brandl2011-03-061-5/+1
| |
* | Merge build identification to default branch.Georg Brandl2011-03-061-1/+5
|\ \ | |/
| * Merge build identification to 3.2 branch.Georg Brandl2011-03-061-1/+5
| |\
| | * Adapt platform and test_platform to the build identification changes.Georg Brandl2011-03-051-1/+5
| | |
| | * Merged revisions 86596 via svnmerge fromEzio Melotti2010-11-211-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line #9424: Replace deprecated assert* methods in the Python test suite. ........