This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add Lib/test/__main__.py in 2.7
Type: enhancement Stage: resolved
Components: Tests Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: ezio.melotti, ncoghlan, serhiy.storchaka, vstinner, xiang.zhang, zach.ware
Priority: normal Keywords:

Created on 2017-05-02 06:56 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 1373 merged serhiy.storchaka, 2017-05-02 07:03
PR 1395 merged serhiy.storchaka, 2017-05-02 18:19
PR 1399 merged vstinner, 2017-05-02 21:29
Messages (15)
msg292720 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-05-02 06:56
Following patch adds Lib/test/__main__.py in 2.7. This allows running tests with 'python -m test' as in 3.x.
msg292722 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-02 07:01
Oh yes, I always wanted this tiny feature! It's painful to have to adapt my command for Python 2 after testing Python 3.
msg292723 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2017-05-02 07:06
+1. Every time when I want to run tests for 2.7, I have to type twice. Once python -m test, error and then python -m test.regrtest.
msg292735 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2017-05-02 09:53
+1 from me. We hadn't done this (or the test.support backport) previously due to the "no new features" guideline, but I think simplifying cross-branch maintenance overrides that concerns.
msg292779 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-05-02 15:26
New changeset 43566aee12a177a7aef5d732abf768251e6b8a12 by Serhiy Storchaka in branch '2.7':
[2.7] bpo-30223: Add Lib/test/__main__.py. (#1373)
https://github.com/python/cpython/commit/43566aee12a177a7aef5d732abf768251e6b8a12
msg292786 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-05-02 17:00
These new features affect only core developers and other contributors fixing bugs in 2.7. I don't think the "no new features" guideline is applicable here.
msg292794 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2017-05-02 18:00
Once again, I agree with the change, but I have an unhappy buildbot :)

http://buildbot.python.org/all/builders/x86%20Gentoo%20Non-Debug%20with%20X%202.7/builds/124

This time it is due to python 2.4 not supporting the absolute_import __future__ feature.  By this point, I think we could get away with just removing the python 2.4 pickle compat tests.
msg292795 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-05-02 18:24
Oh, it is so easy to break test_xpickle. But I think this test is very important. It is pity that test_xpickle is removed in 3.x.

I hope PR 1395 will fix test_xpickle.
msg292796 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2017-05-02 18:35
2.4 is rather far out of date, but PR1395 is simple enough.  I would support re-adding test_xpickle in 3.x, and can ensure that every major version is available on that buildbot to exercise it.
msg292797 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-05-02 18:56
New changeset 8e158b2316385497c7b6b818d8b45855d7f87f0b by Serhiy Storchaka in branch '2.7':
[2.7] bpo-30223: Fix test_xpickle for Python 2.4. (#1395)
https://github.com/python/cpython/commit/8e158b2316385497c7b6b818d8b45855d7f87f0b
msg292798 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-05-02 18:59
Thanks Zachary!
msg292808 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-02 21:23
Hum, it seems like test_regrtest is more and more important. Yet another regression:

http://buildbot.python.org/all/builders/x86%20Gentoo%20Installed%20with%20X%202.7/builds/126/steps/test/logs/stdio

Traceback (most recent call last):
  File "/buildbot/buildarea/2.7.ware-gentoo-x86.installed/build/target/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/buildbot/buildarea/2.7.ware-gentoo-x86.installed/build/target/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/buildbot/buildarea/2.7.ware-gentoo-x86.installed/build/target/lib/python2.7/test/regrtest.py", line 1684, in <module>
    main_in_temp_cwd()
  File "/buildbot/buildarea/2.7.ware-gentoo-x86.installed/build/target/lib/python2.7/test/regrtest.py", line 1664, in main_in_temp_cwd
    TESTCWD = os.path.join(TEMPDIR, TESTCWD)
UnboundLocalError: local variable 'TEMPDIR' referenced before assignment
msg292811 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-02 21:33
> Hum, it seems like test_regrtest is more and more important.

To be fair, I don't think that this particular bug would be catched by the CI since the bug is only triggered on a buildbot which installs Python and runs tests on the installed test suite.

It should be fixed by https://github.com/python/cpython/pull/1399
msg292814 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-02 21:43
New changeset 8105dd7f75b6aa5f812522d452cd378372752a10 by Victor Stinner in branch '2.7':
bpo-30223: Add global in regrtest main_in_temp_cwd (#1399)
https://github.com/python/cpython/commit/8105dd7f75b6aa5f812522d452cd378372752a10
msg293119 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-05-05 16:21
Thank you Victor for fixing this bug.
History
Date User Action Args
2022-04-11 14:58:45adminsetgithub: 74409
2017-05-05 16:21:10serhiy.storchakasetstatus: open -> closed
resolution: fixed
messages: + msg293119
2017-05-02 21:43:27vstinnersetmessages: + msg292814
2017-05-02 21:33:13vstinnersetmessages: + msg292811
2017-05-02 21:29:36vstinnersetpull_requests: + pull_request1508
2017-05-02 21:23:28vstinnersetstatus: closed -> open
resolution: fixed -> (no value)
messages: + msg292808
2017-05-02 18:59:07serhiy.storchakasetmessages: + msg292798
2017-05-02 18:56:54serhiy.storchakasetmessages: + msg292797
2017-05-02 18:35:29zach.waresetmessages: + msg292796
2017-05-02 18:24:21serhiy.storchakasetmessages: + msg292795
2017-05-02 18:19:30serhiy.storchakasetpull_requests: + pull_request1503
2017-05-02 18:00:36zach.waresetnosy: + zach.ware
messages: + msg292794
2017-05-02 17:00:51serhiy.storchakasetstatus: open -> closed
resolution: fixed
messages: + msg292786

stage: resolved
2017-05-02 15:26:28serhiy.storchakasetmessages: + msg292779
2017-05-02 09:53:39ncoghlansetmessages: + msg292735
2017-05-02 07:06:07xiang.zhangsetnosy: + xiang.zhang
messages: + msg292723
2017-05-02 07:03:09serhiy.storchakasetpull_requests: + pull_request1481
2017-05-02 07:01:52vstinnersetnosy: + vstinner
messages: + msg292722
2017-05-02 06:56:56serhiy.storchakacreate