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

hpk at codespeak.net hpk at codespeak.net
Tue Mar 17 08:36:01 CET 2009


Author: hpk
Date: Tue Mar 17 08:35:58 2009
New Revision: 62985

Modified:
   py/trunk/py/test/session.py
   py/trunk/py/test/testing/test_session.py
Log:
rewrite and fix a skipped test 


Modified: py/trunk/py/test/session.py
==============================================================================
--- py/trunk/py/test/session.py	(original)
+++ py/trunk/py/test/session.py	Tue Mar 17 08:35:58 2009
@@ -60,6 +60,8 @@
                     for x in self.genitems(ev.result, keywordexpr):
                         yield x 
                 notify("collectionreport", ev)
+            if self.shouldstop:
+                break
 
     def filteritems(self, colitems):
         """ return items to process (some may be deselected)"""

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	Tue Mar 17 08:35:58 2009
@@ -213,17 +213,10 @@
         assert len(colfail) == 1
         assert len(colskipped) == 1
 
-    def test_minus_x_import_error(self):
-        py.test.skip("fails")
-        o = self.tmpdir
-        tfile = o.join('test_one.py').write(py.code.Source("""
-        xxxx
-        """))
-        tfile2 = o.join('test_two.py').write(py.code.Source("""
-        yyyyy
-        """))
-        sorter = self.events_from_cmdline('-x')
-        finished = sorter.get(event.CollectionReport)
+    def test_minus_x_import_error(self, testdir):
+        testdir.makepyfile(test_one="xxxx", test_two="yyyy")
+        sorter = testdir.inline_run("-x", testdir.tmpdir)
+        finished = sorter.getnamed("collectionreport")
         colfail = [x for x in finished if x.failed]
         assert len(colfail) == 1
 



More information about the pytest-commit mailing list