summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_platform.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-114099: Additions to standard library to support iOS (GH-117052)Russell Keith-Magee2024-03-281-0/+69
| | | | | Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Malcolm Smith <smith@chaquo.com> Co-authored-by: Ned Deily <nad@python.org>
* gh-71042: Add `platform.android_ver` (#116674)Malcolm Smith2024-03-271-0/+50
|
* gh-116491: Improve `test_win32_ver` (#116506)Nikita Sobolev2024-03-131-1/+29
|
* gh-116349: Deprecate `platform.java_ver` function (#116471)Nikita Sobolev2024-03-081-3/+7
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-114099: Add test exclusions to support running the test suite on iOS ↵Russell Keith-Magee2024-02-051-1/+2
| | | | | | | | | | | | | (#114889) Add test annotations required to run the test suite on iOS (PEP 730). The majority of the change involve annotating tests that use subprocess, but are skipped on Emscripten/WASI for other reasons, and including iOS/tvOS/watchOS under the same umbrella as macOS/darwin checks. `is_apple` and `is_apple_mobile` test helpers have been added to identify *any* Apple platform, and "any Apple platform except macOS", respectively.
* gh-102491: Remove IronPython version check in sys_version (#102492)Pieter Eendebak2023-03-191-17/+7
|
* gh-99482: remove `jython` compatibility parts from stdlib and tests (#99484)Nikita Sobolev2022-12-231-1/+1
|
* gh-97966: Restore prior expectation that uname_result._fields and ._asdict ↵Jason R. Coombs2022-11-261-0/+8
| | | | would include the processor. (gh-98343)
* gh-89545: Updates platform module to use new internal _wmi module on Windows ↵Steve Dower2022-09-071-13/+28
| | | | to directly query OS properties (GH-96289)
* bpo-40280: Skip socket, fork, subprocess tests on Emscripten (GH-31986)Christian Heimes2022-03-221-0/+1
| | | | | | | | | | | - Add requires_fork and requires_subprocess to more tests - Skip extension import tests if dlopen is not available - Don't assume that _testcapi is a shared extension - Skip a lot of socket tests that don't work on Emscripten - Skip mmap tests, mmap emulation is incomplete - venv does not work yet - Cannot get libc from executable The "entire" test suite is now passing on Emscripten with EMSDK from git head (91 suites are skipped).
* bpo-40280: Skip subprocess-based tests on wasm32-emscripten (GH-30615)Christian Heimes2022-01-251-0/+2
|
* 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
|