[1.7.x] Fixed bad usage of rstrip() that caused test failure.
If the temporary file name contained a p or y as its last
characters, it would be stripped. refs #23083.
Backport of 57d2b3f2a7
from master
This commit is contained in:
parent
4f8a5bd8d0
commit
d1c08d4758
|
@ -90,7 +90,7 @@ class TestFilenameGenerator(TestCase):
|
||||||
_, filepath = tempfile.mkstemp(dir=os.path.dirname(upath(__file__)), suffix='.py')
|
_, filepath = tempfile.mkstemp(dir=os.path.dirname(upath(__file__)), suffix='.py')
|
||||||
try:
|
try:
|
||||||
_, filename = os.path.split(filepath)
|
_, filename = os.path.split(filepath)
|
||||||
import_module('.%s' % filename.rstrip('.py'), package='utils_tests')
|
import_module('.%s' % filename.replace('.py', ''), package='utils_tests')
|
||||||
self.assertIn(filepath, gen_filenames())
|
self.assertIn(filepath, gen_filenames())
|
||||||
finally:
|
finally:
|
||||||
os.remove(filepath)
|
os.remove(filepath)
|
||||||
|
|
Loading…
Reference in New Issue