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: unittest's main don't handle TestSuite in command line
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: purcell Nosy List: purcell, tebeka
Priority: normal Keywords: patch

Created on 2003-09-11 06:52 by tebeka, last changed 2022-04-10 16:11 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
patch.txt tebeka, 2003-09-11 06:52 Path for unittest.py
Messages (2)
msg44601 - (view) Author: Miki Tebeka (tebeka) * Date: 2003-09-11 06:52
When using unittest's "main" it fails if in the command
line a name of TestSuite class is given.

Suppose ts.py is:
----
#!/usr/bin/env python

from unittest import TestCase, makeSuite, main

class T(TestCase):
    def test_moo(self):
        self.fail()


test_suite = makeSuite(T, "test_")

if __name__ == "__main__":
    main()
----

Then running "ts.py test_suite" will fail.

Attached is a patch for unittest.py

Miki
msg44602 - (view) Author: Steve Purcell (purcell) (Python triager) Date: 2003-12-06 13:25
Logged In: YES 
user_id=21477

This is fixed in Python and PyUnit CVS, and will be released either with 
2.3.3 or 2.4. 
History
Date User Action Args
2022-04-10 16:11:06adminsetgithub: 39215
2003-09-11 06:52:22tebekacreate