mirror of
https://github.com/python/cpython.git
synced 2025-09-19 23:20:25 +00:00
Captured IO streams with embedded backslashes are always such a fun combination...
This commit is contained in:
parent
9466fe88a7
commit
e98e8a3aa8
1 changed files with 8 additions and 2 deletions
|
@ -989,7 +989,13 @@ class test_TemporaryDirectory(TC):
|
||||||
# Issue 10888: may write to stderr if modules are nulled out
|
# Issue 10888: may write to stderr if modules are nulled out
|
||||||
# ResourceWarning will be triggered by __del__
|
# ResourceWarning will be triggered by __del__
|
||||||
with self.do_create() as dir:
|
with self.do_create() as dir:
|
||||||
d = self.do_create(dir=dir)
|
if os.sep != '\\':
|
||||||
|
# Embed a backslash in order to make sure string escaping
|
||||||
|
# in the displayed error message is dealt with correctly
|
||||||
|
suffix = '\\check_backslash_handling'
|
||||||
|
else:
|
||||||
|
suffix = ''
|
||||||
|
d = self.do_create(dir=dir, suf=suffix)
|
||||||
|
|
||||||
#Check for the Issue 10888 message
|
#Check for the Issue 10888 message
|
||||||
modules = [os, os.path]
|
modules = [os, os.path]
|
||||||
|
@ -998,7 +1004,7 @@ class test_TemporaryDirectory(TC):
|
||||||
with support.captured_stderr() as err:
|
with support.captured_stderr() as err:
|
||||||
with NulledModules(*modules):
|
with NulledModules(*modules):
|
||||||
d.cleanup()
|
d.cleanup()
|
||||||
message = err.getvalue()
|
message = err.getvalue().replace('\\\\', '\\')
|
||||||
self.assertIn("while cleaning up", message)
|
self.assertIn("while cleaning up", message)
|
||||||
self.assertIn(d.name, message)
|
self.assertIn(d.name, message)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue