classification
Title: Flag "-3" is silently ignored when running "regrtest.py -j2"
Type: behavior Stage: committed/rejected
Components: Tests Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: flox, lemburg, pitrou
Priority: normal Keywords: patch

Created on 2009-12-15 17:47 by flox, last changed 2010-10-14 11:19 by pitrou. This issue is now closed.

Files
File name Uploaded Description Edit
issue7516_regrtest_mp.diff flox, 2009-12-15 17:50 Patch, apply to trunk review
Messages (6)
msg96452 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2009-12-15 17:47
~ $ ./python -3 Lib/test/regrtest.py -j2 test_py3kwarn
./Lib/encodings/__init__.py:100: DeprecationWarning:
                         the 'hex' codec has been removed in Python 3.0
  level=0)
test_py3kwarn
test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag
1 test skipped:
    test_py3kwarn
1 skip unexpected on linux2:
    test_py3kwarn
msg96453 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2009-12-15 17:50
Minimal patch proposed.
msg96456 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2009-12-15 19:20
flox wrote:
> 
> New submission from flox <laxyf@yahoo.fr>:
> 
> ~ $ ./python -3 Lib/test/regrtest.py -j2 test_py3kwarn
> ./Lib/encodings/__init__.py:100: DeprecationWarning:
>                          the 'hex' codec has been removed in Python 3.0
>   level=0)
> test_py3kwarn
> test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag
> 1 test skipped:
>     test_py3kwarn
> 1 skip unexpected on linux2:
>     test_py3kwarn

I'm not sure where you are getting that warning from: it doesn't
exist in Python 2.7 (trunk) and will likely never exist, since we're
going to add that codec back to 3.1. See issue 7475.

Still, even without it, you get the error:

Python/Dev-Python> ./python -3 Lib/test/regrtest.py -j2 test_py3kwarn
test_py3kwarn
test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag
1 test skipped:
    test_py3kwarn
1 skip unexpected on linux2:
    test_py3kwarn

The reason is simple: when starting secondary processes to run the
tests, regrtest.py doesn't pass along the Python interpreter flags
to the secondary Python executeables.

It also ignores the environment variables by forcing the -E
option.
msg96459 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2009-12-15 19:38
This issue (and the patch) is to warn the tester that the flags and
environment variables are ignored.

Sorry for the DeprecationWarning noise, it is some silly test on my sandbox.
msg96463 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2009-12-15 19:57
Instead of just warning the user, wouldn't it be better to add proper
support for inheriting the env vars and other Python command line flags ?

Whether or not to use -E can be determined via the test module name.

The -3 flag and others can be queried via sys.flags.
msg118649 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-10-14 11:19
Fixed in r85471.
History
Date User Action Args
2010-10-14 11:19:04pitrousetstatus: open -> closed

nosy: + pitrou
versions: - Python 2.6
messages: + msg118649

resolution: fixed
stage: committed/rejected
2009-12-15 19:57:26lemburgsetmessages: + msg96463
2009-12-15 19:38:48floxsetmessages: + msg96459
2009-12-15 19:20:12lemburgsetnosy: + lemburg
messages: + msg96456
2009-12-15 17:50:28floxsetfiles: + issue7516_regrtest_mp.diff
keywords: + patch
messages: + msg96453
2009-12-15 17:47:50floxcreate