Commits

Anonymous committed 7efa726

Added a package of example tests for ... testing

  • Participants
  • Parent commits db255d6

Comments (0)

Files changed (4)

File nose2/plugins/loader_compat.py

     def loadTestsFromModule(self, event):
         module = event.module
         # shim to make nose-style implicit generators
-        # and test functions work with moduleloading plugin
+        # and test function fixtures work with moduleloading plugin
         for attr in dir(module):
             item = getattr(module, attr, None)
             if inspect.isfunction(item):

File support/pkg1/__init__.py

+#

File support/pkg1/test/__init__.py

+#

File support/pkg1/test/test_things.py

+import unittest2
+
+class SomeTests(unittest2.TestCase):
+
+    def test_ok(self):
+        pass
+
+    def test_typeerr(self):
+        raise TypeError("oops")
+
+    def test_failed(self):
+        assert False, "I failed"
+
+    def test_skippy(self):
+        raise unittest2.SkipTest("I wanted to skip")
+
+
+def test_func():
+    assert 1 == 1
+
+
+def test_gen():
+    def check(a, b):
+        assert a == b
+    for i in range(0, 5):
+        yield check, (i, i,)
+
+
+did_setup = False
+def setup():
+    global did_setup
+    did_setup = True
+
+
+def test_fixt():
+    assert did_setup
+test_fixt.setup = setup
+