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: '-m unittest' should not pretend it works on Python 2.5/2.6
Type: behavior Stage: resolved
Components: Tests Versions: Python 2.6, Python 2.5
process
Status: closed Resolution: wont fix
Dependencies: Superseder: "python -m unittest <testmodule>" does not run any tests
View: 6514
Assigned To: Nosy List: amaury.forgeotdarc, eric.araujo, ezio.melotti, georg.brandl, michael.foord, techtonik
Priority: normal Keywords:

Created on 2011-04-10 07:35 by techtonik, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (9)
msg133449 - (view) Author: anatoly techtonik (techtonik) Date: 2011-04-10 07:35
The following command is broken on Python 2.5/2.6
  python -m unittest test_file
It outputs

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK

But in Python 2.7 the same command works

----------------------------------------------------------------------
Ran 1 tests in 0.000s

OK

It is even more confusing with test class method on command line:
  python26 -m unittest test_file.SomeTest
Traceback (most recent call last):
  ...
  File "C:\~env\Python26\lib\unittest.py", line 598, in loadTestsFromName
    test = obj()
  File "C:\~env\Python26\lib\unittest.py", line 216, in __init__
    (self.__class__, methodName)
ValueError: no such test method in <class 'test_file.SomeTest'>: runTest


--- 
I know that our <...> policy denies backporting such fixes to Python 2.5/2.6, but such things that make an illusion that they work while in fact they never did - see #6514, make Python really suxx. I can feel user frustration while trying to maintain 2.6 compatibility and wasting time trying to run test suite. I wouldn't mind if `-m unittest` won't work in non-supported versions, but it should at least point to bug report.

(if I'll ever switch to Ruby - this one will definitely be in the list reasons)
msg133456 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2011-04-10 09:20
Isn't this an exact duplicate of issue6514? Or do you suggest something else?
msg133460 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2011-04-10 09:35
Yes, this is a duplicate.
msg133804 - (view) Author: anatoly techtonik (techtonik) Date: 2011-04-15 10:25
#6514 is to make `-m unittest` work run on 2.5/2.6.

This bug is not to fix it, but to stop displaying confusing messages. It will be enough to exit with a message like:

  "`-m unittest` call is not supported in Python 2.5/2.6 - use something else (nose?) instead"
msg133805 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2011-04-15 11:01
2.5 / 2.6 are in security fix only mode. So this won't get fixed. Please don't reopen.
msg133823 - (view) Author: anatoly techtonik (techtonik) Date: 2011-04-15 13:51
I need a "why-python-suxx" keyword to point people with dumb questions about why they should not use specific Python versions to a query that lists all sensitive issues for this specific version that won't be fixed due to security fix only mode.
msg133825 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2011-04-15 13:59
At some point we have to draw the line, otherwise we would have to backport things to 2.3 and 2.4 too.  We are already maintaining 4 branches (2.7, 3.1, 3.2, 3.3).
msg133827 - (view) Author: anatoly techtonik (techtonik) Date: 2011-04-15 14:26
I know. But stuff like this is necessary for proper release management and future planning. Using "why-python-suxx per module" ™ metric, it is possible to pinpoint badly designed parts that should be removed or replaced in Python4.
msg133846 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-04-15 16:49
> I need a "why-python-suxx" keyword to point people with dumb
> questions about why they should not use specific Python versions to a
> query that lists all sensitive issues for this specific version that
> won't be fixed due to security fix only mode.

You may not know it, but repeating over and other that Python, its docs, its development process and/or its developers suck does not raise the incentive to change things.  We’re all volunteers doing our best in our free time, please keep that in mind.  Also consider that when one person keeps saying that everything sucks while other people say that the overall quality is good, it may be that the first person is wrong.

As Ezio said, we have to draw the line.  A constructive outcome of this bug would be a doc patch adding a versionadded directive to the 2.7 docs, which we can fix (and we know that people tend to use the latest version of the docs). 

Leaving aside the inconsiderate comments about suckage, constructive proposals do help.  A lot of things in the current process are good, and you should accept the word of the actual developers for it.  Also remember that both PSF and python-dev are increasingly welcoming of   contributors and trying to improve things.  However, I think it’s best to let the people who actually manage the releases to judge whether changes are required for “proper release management and future planning”.

In other words, you catch more flies with wine than vinegar.
History
Date User Action Args
2022-04-11 14:57:16adminsetgithub: 56028
2011-04-15 16:49:36eric.araujosetnosy: + eric.araujo
messages: + msg133846
2011-04-15 14:26:25techtoniksetmessages: + msg133827
2011-04-15 13:59:37ezio.melottisetmessages: + msg133825
2011-04-15 13:51:22techtoniksetresolution: duplicate -> wont fix
messages: + msg133823
2011-04-15 11:01:38michael.foordsetstatus: open -> closed

messages: + msg133805
stage: resolved
2011-04-15 10:25:01techtoniksetstatus: closed -> open

messages: + msg133804
title: 'unittest -m' should not pretend it works on Python 2.5/2.6 -> '-m unittest' should not pretend it works on Python 2.5/2.6
2011-04-10 09:35:21georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg133460

superseder: "python -m unittest <testmodule>" does not run any tests
resolution: duplicate
2011-04-10 09:20:54amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg133456
2011-04-10 07:37:06ezio.melottisetnosy: + ezio.melotti, michael.foord
2011-04-10 07:35:31techtonikcreate