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.
This commit is contained in:
Tim Graham 2014-07-25 15:11:34 -04:00
parent b8cb5ba708
commit 57d2b3f2a7
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ class TestFilenameGenerator(TestCase):
_, filepath = tempfile.mkstemp(dir=os.path.dirname(upath(__file__)), suffix='.py')
try:
_, 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())
finally:
os.remove(filepath)