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.
Created on 2012年03月16日 07:45 by anacrolix, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue14333_decorators.patch | maker, 2012年03月17日 17:51 | review | ||
| issue14333.patch | maker, 2012年03月17日 17:51 | review | ||
| Messages (6) | |||
|---|---|---|---|
| msg156006 - (view) | Author: Matt Joiner (anacrolix) | Date: 2012年03月16日 07:45 | |
$ python3.3 -m unittest test.test_queue Generates errors in the unit test code of the form AttributeError: 'BaseQueueTest' object has no attribute 'type2test' |
|||
| msg156183 - (view) | Author: Michele Orrù (maker) * | Date: 2012年03月17日 17:51 | |
This bug is becouse of Lib/unittest/loader.py:107 . So a quick fix would be to inherit from unittest.TestCase only in the exposed classes; but probably using a class decorator is the best solution. |
|||
| msg156187 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2012年03月17日 18:06 | |
The decorator solution looks overly mind-boggling for this simple case. BTW, I'm not sure we support calling our tests in this way, but it would be a good goal to, so I'm in favor of fixing these kinds of problems. |
|||
| msg156201 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年03月17日 20:45 | |
New changeset 118f7bdd631b by R David Murray in branch '3.2': #14333: fix test_queue so it can be run via standard unittest test discovery. http://hg.python.org/cpython/rev/118f7bdd631b New changeset 3ea4d7adb3e7 by R David Murray in branch 'default': Merge #14333: fix test_queue so it can be run via standard unittest test discovery. http://hg.python.org/cpython/rev/3ea4d7adb3e7 New changeset 340053208864 by R David Murray in branch '2.7': #14333: fix test_queue so it can be run via standard unittest test discovery. http://hg.python.org/cpython/rev/340053208864 |
|||
| msg156202 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年03月17日 20:49 | |
Not only do I think we should support calling our tests via unittest, I think we should move in the direction of having regrtest be implemented via standard unittest hooks rather than the monster it currently is. That will take quite a bit of effort, though :) Given that we are in fact using unittest, I think it is much clearer to follow the standard unittest pattern and have tests that are supposed to be run marked by subclassing TestCase, rather than by being explicitly nominated in boilerplate at the bottom. Certainly any new test files I write work that way (and I even explicitly use test discovery in test_email). |
|||
| msg156220 - (view) | Author: Matt Joiner (anacrolix) | Date: 2012年03月18日 01:06 | |
Yes, FWIW much of the standard library tests are callable this way without issue. I have patches that fix the discoverability of a few test modules. I'll submit these in another issue. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:28 | admin | set | github: 58541 |
| 2012年03月18日 01:06:25 | anacrolix | set | messages: + msg156220 |
| 2012年03月17日 20:49:40 | r.david.murray | set | status: open -> closed versions: + Python 2.7, Python 3.2 nosy: + r.david.murray messages: + msg156202 resolution: fixed stage: resolved |
| 2012年03月17日 20:45:35 | python-dev | set | nosy:
+ python-dev messages: + msg156201 |
| 2012年03月17日 18:06:47 | georg.brandl | set | nosy:
+ georg.brandl messages: + msg156187 |
| 2012年03月17日 17:51:42 | maker | set | files: + issue14333.patch |
| 2012年03月17日 17:51:25 | maker | set | files:
+ issue14333_decorators.patch keywords: + patch messages: + msg156183 |
| 2012年03月17日 17:25:18 | maker | set | nosy:
+ maker |
| 2012年03月16日 07:45:44 | anacrolix | create | |