Set the __test__ attribute on gen_test to False.

Without this, if a nose-using project imported gen_test nose would try
to run it as a test.
This commit is contained in:
Ben Darnell 2013-04-02 00:11:10 -04:00
parent 85478c5449
commit fc96700298
1 changed files with 5 additions and 0 deletions

View File

@ -377,6 +377,11 @@ def gen_test(f):
return wrapper
# Without this attribute, nosetests will try to run gen_test as a test
# anywhere it is imported.
gen_test.__test__ = False
class LogTrapTestCase(unittest.TestCase):
"""A test case that captures and discards all logging output
if the test passes.