[Python-checkins] cpython (merge default -> default): merge
raymond.hettinger
python-checkins at python.org
Thu May 5 23:16:51 CEST 2011
http://hg.python.org/cpython/rev/8a27d7fc194e
changeset: 69864:8a27d7fc194e
parent: 69863:444574740f5d
parent: 69861:13bd08461599
user: Raymond Hettinger <python at rcn.com>
date: Thu May 05 14:16:16 2011 -0700
summary:
merge
files:
Lib/test/test_logging.py | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -3494,9 +3494,19 @@
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
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list