[Python-modules-commits] [fakesleep] 03/03: broken-flushWarnings

Free Ekanayaka freee at moszumanska.debian.org
Mon Oct 31 12:02:30 UTC 2016


This is an automated email from the git hooks/post-receive script.

freee pushed a commit to branch patch-queue/master
in repository fakesleep.

commit cfeaf01ece870762d0a7f19d10e06f730a775d1f
Author: Free Ekanayaka <freee at debian.org>
Date:   Mon Oct 31 10:31:46 2016 +0000

    broken-flushWarnings
    
    Fix spurious unit tests failures due to broken behavior in
    SynchronousTestCase.flushWarnings, which ends up skipping
    warnings. See this code around 1160:
    
    aModule = sys.modules[aFunction.__module__]
    filename = inspect.getabsfile(aModule)
    
    if filename != os.path.normcase(aWarning.filename):
        continue
---
 src/incremental/tests/test_version.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/incremental/tests/test_version.py b/src/incremental/tests/test_version.py
index 75129af..0ccd8e9 100644
--- a/src/incremental/tests/test_version.py
+++ b/src/incremental/tests/test_version.py
@@ -9,6 +9,7 @@ from __future__ import division, absolute_import
 
 import sys
 import operator
+import unittest
 
 from tempfile import mkdtemp
 
@@ -148,7 +149,7 @@ class VersionsTests(TestCase):
         Passing 'prerelease' to Version is deprecated.
         """
         Version("whatever", 1, 0, 0, prerelease=1)
-        warnings = self.flushWarnings([self.test_prereleaseDeprecated])
+        warnings = self.flushWarnings()
         self.assertEqual(len(warnings), 1)
         self.assertEqual(
             warnings[0]['message'],
@@ -161,8 +162,7 @@ class VersionsTests(TestCase):
         """
         va = Version("whatever", 1, 0, 0, release_candidate=1)
         va.prerelease
-        warnings = self.flushWarnings(
-            [self.test_prereleaseAttributeDeprecated])
+        warnings = self.flushWarnings()
         self.assertEqual(len(warnings), 1)
         self.assertEqual(
             warnings[0]['message'],

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/fakesleep.git



More information about the Python-modules-commits mailing list