[py-svn] commit/pytest: hpk42: fix slightly wrong verbose output for non subclasses on windows

Bitbucket commits-noreply at bitbucket.org
Tue Mar 8 13:37:10 CET 2011


1 new changeset in pytest:

http://bitbucket.org/hpk42/pytest/changeset/6cbbd04b2f99/
changeset:   r2180:6cbbd04b2f99
user:        hpk42
date:        2011-03-08 13:37:00
summary:     fix slightly wrong verbose output for non subclasses on windows
affected #:  3 files (581 bytes)

--- a/CHANGELOG	Mon Mar 07 18:28:45 2011 +0100
+++ b/CHANGELOG	Tue Mar 08 13:37:00 2011 +0100
@@ -41,6 +41,9 @@
 - fixed typos in the docs (thanks Victor Garcia, Brianna Laugher) and particular
   thanks to Laura Creighton who also revieved parts of the documentation.
 
+- fix slighly wrong output of verbose progress reporting for classes 
+  (thanks Amaury)
+
 - more precise (avoiding of) deprecation warnings for node.Class|Function accesses
 
 - avoid std unittest assertion helper code in tracebacks (thanks Ronny)


--- a/_pytest/terminal.py	Mon Mar 07 18:28:45 2011 +0100
+++ b/_pytest/terminal.py	Tue Mar 08 13:37:00 2011 +0100
@@ -283,7 +283,7 @@
             return
         #for i, testarg in enumerate(self.config.args):
         #    self.write_line("test path %d: %s" %(i+1, testarg))
-        
+
     def _printcollecteditems(self, items):
         # to print out items and their parent collectors
         # we take care to leave out Instances aka ()
@@ -335,7 +335,7 @@
                 excrepr.reprcrash.toterminal(self._tw)
 
     def _locationline(self, collect_fspath, fspath, lineno, domain):
-        if fspath and fspath != collect_fspath:
+        if fspath and fspath.replace("\\", "/") != collect_fspath:
             fspath = "%s <- %s" % (collect_fspath, fspath)
         if lineno is not None:
             lineno += 1


--- a/testing/test_terminal.py	Mon Mar 07 18:28:45 2011 +0100
+++ b/testing/test_terminal.py	Tue Mar 08 13:37:00 2011 +0100
@@ -130,6 +130,20 @@
             "*test_p2.py <- *test_p1.py:2: TestMore.test_p1*",
         ])
 
+    def test_itemreport_directclasses_not_shown_as_subclasses(self, testdir):
+        a = testdir.mkpydir("a")
+        a.join("test_hello.py").write(py.code.Source("""
+            class TestClass:
+                def test_method(self):
+                    pass
+        """))
+        result = testdir.runpytest("-v")
+        assert result.ret == 0
+        result.stdout.fnmatch_lines([
+            "*a/test_hello.py*PASS*",
+        ])
+        assert " <- " not in result.stdout.str()
+
     def test_keyboard_interrupt(self, testdir, option):
         p = testdir.makepyfile("""
             def test_foobar():
@@ -399,6 +413,7 @@
             "*test_verbose_reporting.py:10: test_gen*FAIL*",
         ])
         assert result.ret == 1
+
         pytestconfig.pluginmanager.skipifmissing("xdist")
         result = testdir.runpytest(p1, '-v', '-n 1')
         result.stdout.fnmatch_lines([
@@ -507,7 +522,7 @@
     result.stderr.fnmatch_lines([
         "*registered*PluginManager*"
     ])
-    
+
 
 class TestGenericReporting:
     """ this test class can be subclassed with a different option

Repository URL: https://bitbucket.org/hpk42/pytest/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the pytest-commit mailing list