[py-svn] r54623 - in py/trunk/py/test: . testing

fijal at codespeak.net fijal at codespeak.net
Sat May 10 15:55:23 CEST 2008


Author: fijal
Date: Sat May 10 15:55:22 2008
New Revision: 54623

Modified:
   py/trunk/py/test/session.py
   py/trunk/py/test/testing/setupdata.py
   py/trunk/py/test/testing/test_session.py
Log:
A test for 54622
Fix for running tests


Modified: py/trunk/py/test/session.py
==============================================================================
--- py/trunk/py/test/session.py	(original)
+++ py/trunk/py/test/session.py	Sat May 10 15:55:22 2008
@@ -33,7 +33,7 @@
         if isinstance(next, stopitems):
             try:
                 next._skipbykeyword(keyword)
-                if session.config.option.keyword_oneshot:
+                if session and session.config.option.keyword_oneshot:
                     keyword = None
                 yield next
             except Skipped:

Modified: py/trunk/py/test/testing/setupdata.py
==============================================================================
--- py/trunk/py/test/testing/setupdata.py	(original)
+++ py/trunk/py/test/testing/setupdata.py	Sat May 10 15:55:22 2008
@@ -91,6 +91,19 @@
         def test_three():
             assert 1
     ''')),
+    ('testevenmore.py', py.code.Source('''
+        def test_one():
+            assert 1
+
+        def test_two():
+            assert 1
+
+        def test_three():
+            assert 1
+
+        def test_four():
+            assert 1
+            ''')),
 
     ('testspecial_importerror.py', py.code.Source('''
 

Modified: py/trunk/py/test/testing/test_session.py
==============================================================================
--- py/trunk/py/test/testing/test_session.py	(original)
+++ py/trunk/py/test/testing/test_session.py	Sat May 10 15:55:22 2008
@@ -118,13 +118,13 @@
             assert l[0].item.name == 'test_1'
 
     def test_select_starton(self):
-        config = py.test.config._reparse([datadir/'testmore.py', 
-                                          '-j', '-k', "test_two"])
+        config = py.test.config._reparse([datadir/'testevenmore.py', 
+                                          '-j', '-k', "test_three"])
         all = []
         session = config._getsessionclass()(config)
         session.main(all.append)
         assert len(getpassed(all)) == 2
-        assert len(getskipped(all)) == 1
+        assert len(getskipped(all)) == 2
         
    
 class TestTerminalSession:


More information about the py-svn mailing list