Skip to content

[2.7] bpo-30223: Add Lib/test/__main__.py. #1373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 2, 2017

Conversation

serhiy-storchaka
Copy link
Member

To unify running tests in Python 2.7 and Python 3, the test
package can be run as a script. This is equivalent to running the
test.regrtest module as a script.

To unify running tests in Python 2.7 and Python 3, the test
package can be run as a script.  This is equivalent to running the
test.regrtest module as a script.
@serhiy-storchaka serhiy-storchaka added the tests Tests in the Lib/test dir label May 2, 2017
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested your change, and it doesn't work.

Did you forget to include Lib/test/main.py as mentioned in the commit title?

@@ -195,7 +199,7 @@ tests.
.. note::

The :mod:`test.test_support` module has been renamed to :mod:`test.support`
in Python 3.x and 2.7.13. The name ``test.test_support`` has been retained
in Python 3.x and 2.7.14. The name ``test.test_support`` has been retained
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is ok: the commit a694e09 is not part of Python 2.7.13.

@vstinner
Copy link
Member

vstinner commented May 2, 2017

(Maybe it's time to backport test_regrtest.py :-) It's up to you, just add main.py and it will be ok.)

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Add missed Lib/test/main.py."

Ah, it's now better: it works ;-)

@serhiy-storchaka serhiy-storchaka merged commit 43566ae into python:2.7 May 2, 2017
@serhiy-storchaka serhiy-storchaka deleted the test-__main__ branch May 2, 2017 15:26
@serhiy-storchaka
Copy link
Member Author

Maybe it's time to backport test_regrtest.py :-)

test_regrtest.py mainly tests regrtest._parse_args() which doesn't exist in 2.7. It was added when regrtest was switched from using getopt to using argparse. This was a large change.

@vstinner
Copy link
Member

vstinner commented May 2, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants