summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2011-05-05 21:16:16 (GMT)
committerRaymond Hettinger <python@rcn.com>2011-05-05 21:16:16 (GMT)
commit7b48432a77c9a3e902e28fa654882f04c38423fd (patch)
tree2b9494e648d8109d894fd7e2efd1083425d8d6dd
parent474ee6c8d0f47a82b44a35e1cdc8276c89ce6021 (diff)
parent28338fbdbabcee4ed7d88d01dfe06cd3cbff9f58 (diff)
downloadcpython-7b48432a77c9a3e902e28fa654882f04c38423fd.zip
cpython-7b48432a77c9a3e902e28fa654882f04c38423fd.tar.gz
cpython-7b48432a77c9a3e902e28fa654882f04c38423fd.tar.bz2
merge
-rw-r--r--Lib/test/test_logging.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index fe42594..ff9eb66 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -3494,9 +3494,19 @@ class TimedRotatingFileHandlerTest(BaseFileTest):
earlier = now - datetime.timedelta(seconds=2)
fn1 = self.fn + prevsec.strftime(".%Y-%m-%d_%H-%M-%S")
fn2 = self.fn + earlier.strftime(".%Y-%m-%d_%H-%M-%S")
- self.assertTrue(os.path.exists(fn1) or
- os.path.exists(fn2),
- msg="Neither exists: %s nor %s" % (fn1, fn2))
+ success = os.path.exists(fn1) or os.path.exists(fn2)
+ if not success:
+ # print additional diagnostic information
+ print('Neither %s nor %s exists' % (fn1, fn2), file=sys.stderr)
+ dirname = os.path.dirname(fn1)
+ files = os.listdir(dirname)
+ files = [f for f in files if f.startswith('test_logging-2-')]
+ print('matching files: %s' % files, file=sys.stderr)
+ self.assertTrue(success)
+ for fn in (fn1, fn2):
+ if os.path.exists(fn):
+ self.rmfiles.append(fn)
+
def test_invalid(self):
assertRaises = self.assertRaises