Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 383 by
alessand...@gmail.com: loadTestsFromName does not work on
method with a decorator
http://code.google.com/p/rietveld/issues/detail?id=383
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.