gco / rietveld

Automatically exported from code.google.com/p/rietveld
Apache License 2.0
0 stars 0 forks source link

loadTestsFromName does not work on method with a decorator #383

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Steps to reproduce the problem.
1. Create a module (ex. name it "test") 
2. Create a file in it (ex. mainTest.py) with a class (ex. MainTest) derived 
from TestCase.
3. Create a test method in that class, (ex. test_base), prefix it with "test".
4. Create a decorator (ex. clear_args) and use it on the test method 
5. Create a test suite with the function "loadTestsFromName" of TestLoader 
class and make a TestRunner run it (I use a TextTestRunner). 
suite = 
unittest.TestLoader().loadTestsFromName('test.mainTest.MainTest.test_base')
unittest.TextTestRunner(verbosity=2).run(suite)

It is expected that the test is run (it runs without decorator).
It gives an error: no such test method in <class 'test.mainTest.MainTest'>: 
wrapper.
"wrapper" is the name of the returned function in the decorator.

I'm using Python 2.7.3 on Windows 7 64bit.

I'm accessing by code.google.com.

Original issue reported on code.google.com by alessandro.piccione.75 on 31 May 2012 at 5:51

GoogleCodeExporter commented 9 years ago
This bug has nothing to do with Rietveld. If you think this is a Python bug, 
please use the Python bug tracker: bugs.python.org.

Original comment by gvanrossum@gmail.com on 31 May 2012 at 5:56

GoogleCodeExporter commented 9 years ago
Sorry. 
I reported this bug (I think it is) in Python tracker like you suggest. 
Thank you.

Original comment by alessandro.piccione.75 on 31 May 2012 at 7:09