From fc967002989971889bc269be1c811aa815811dc5 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Tue, 2 Apr 2013 00:11:10 -0400 Subject: [PATCH] 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. --- tornado/testing.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tornado/testing.py b/tornado/testing.py index f92abab3..b7d2881e 100644 --- a/tornado/testing.py +++ b/tornado/testing.py @@ -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.