summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetri Lehtinen <petri@digip.org>2012-09-01 11:25:48 (GMT)
committerPetri Lehtinen <petri@digip.org>2012-09-01 11:25:48 (GMT)
commit80f4553d56e88c002a0085afdc8a33b9d0bf0202 (patch)
tree3aea39fc19fb30913b8085e3cc44269a9048adde
parentf9e1f1128b1d040cabb519ab18f770aa0c456744 (diff)
downloadcpython-80f4553d56e88c002a0085afdc8a33b9d0bf0202.zip
cpython-80f4553d56e88c002a0085afdc8a33b9d0bf0202.tar.gz
cpython-80f4553d56e88c002a0085afdc8a33b9d0bf0202.tar.bz2
#15802: Fix test logic in TestMaildir.test_create_tmp
-rw-r--r--Lib/test/test_mailbox.py10
-rw-r--r--Misc/NEWS3
2 files changed, 8 insertions, 5 deletions
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py
index 5069aac..b4a0fdf 100644
--- a/Lib/test/test_mailbox.py
+++ b/Lib/test/test_mailbox.py
@@ -660,13 +660,13 @@ class TestMaildir(TestMailbox, unittest.TestCase):
self.assertTrue(match is not None, "Invalid file name: '%s'" % tail)
groups = match.groups()
if previous_groups is not None:
- self.assertTrue(int(groups[0] >= previous_groups[0]),
+ self.assertGreaterEqual(int(groups[0]), int(previous_groups[0]),
"Non-monotonic seconds: '%s' before '%s'" %
(previous_groups[0], groups[0]))
- self.assertTrue(int(groups[1] >= previous_groups[1]) or
- groups[0] != groups[1],
- "Non-monotonic milliseconds: '%s' before '%s'" %
- (previous_groups[1], groups[1]))
+ if int(groups[0]) == int(previous_groups[0]):
+ self.assertGreaterEqual(int(groups[1]), int(previous_groups[1]),
+ "Non-monotonic milliseconds: '%s' before '%s'" %
+ (previous_groups[1], groups[1]))
self.assertTrue(int(groups[2]) == pid,
"Process ID mismatch: '%s' should be '%s'" %
(groups[2], pid))
diff --git a/Misc/NEWS b/Misc/NEWS
index 13e8b00..0a35f0e 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -352,6 +352,9 @@ Library
Tests
-----
+- Issue #15802: Fix test logic in TestMaildir.test_create_tmp. Patch
+ by Serhiy Storchaka.
+
- Issue #15765: Extend a previous fix to Solaris and OpenBSD for quirky
getcwd() behaviour (issue #9185) to NetBSD as well.