diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2014-10-22 12:53:54 -0500 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2014-11-10 17:35:43 -0600 |
commit | b50d7b239f5b6530873df25a80dde484f955581c (patch) | |
tree | 94608f3d954da7f8a9d1f3aabecee13bfc1c3797 /testsuite/Testsrc/Testlib/TestOptions/TestOptions.py | |
parent | 4ec92cb9e7d1eb2f90d36e5255ee8814ca0a8513 (diff) | |
download | bcfg2-b50d7b239f5b6530873df25a80dde484f955581c.tar.gz bcfg2-b50d7b239f5b6530873df25a80dde484f955581c.tar.bz2 bcfg2-b50d7b239f5b6530873df25a80dde484f955581c.zip |
testsuite: unlink temporary files
This cleans up the temporary config files created by the option
parsing unit tests. Courtesy Alexander Sulfrian.
Diffstat (limited to 'testsuite/Testsrc/Testlib/TestOptions/TestOptions.py')
-rw-r--r-- | testsuite/Testsrc/Testlib/TestOptions/TestOptions.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/testsuite/Testsrc/Testlib/TestOptions/TestOptions.py b/testsuite/Testsrc/Testlib/TestOptions/TestOptions.py index 9f4a7873c..94d30dd3a 100644 --- a/testsuite/Testsrc/Testlib/TestOptions/TestOptions.py +++ b/testsuite/Testsrc/Testlib/TestOptions/TestOptions.py @@ -400,9 +400,12 @@ class TestBasicOptions(OptionTestCase): fh.write("test") fh.close() - parser.parse(["-C", config_file, "--test", name]) - self.assertEqual(result.test.name, name) - self.assertEqual(result.test.read(), "test") + try: + parser.parse(["-C", config_file, "--test", name]) + self.assertEqual(result.test.name, name) + self.assertEqual(result.test.read(), "test") + finally: + os.unlink(name) @clean_environment @make_config() |