Anonymous avatar Anonymous committed 7efa726

Added a package of example tests for ... testing

Comments (0)

Files changed (4)

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):

support/pkg1/__init__.py

+#

support/pkg1/test/__init__.py

+#

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
+
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.