From d295142a4d7bfb86576009854dc6f351edc1152b Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sun, 4 Jan 2015 14:44:12 -0500 Subject: [PATCH] In testing, reset config options in tearDown so subsequent tests are not affected --- gramps/cli/test/cli_test.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gramps/cli/test/cli_test.py b/gramps/cli/test/cli_test.py index 710f50add..87f01322e 100644 --- a/gramps/cli/test/cli_test.py +++ b/gramps/cli/test/cli_test.py @@ -133,23 +133,25 @@ class UnicodeTest(unittest.TestCase): def setUp(self): from gramps.cli.clidbman import CLIDbManager - from gramps.gen.config import set as setconfig + from gramps.gen.config import set as setconfig, get as getconfig from gramps.gen.dbstate import DbState self.newpath = os.path.join(os.path.dirname(__file__), cuni('\u0393\u03c1\u03b1\u03bc\u03c3\u03c0')) self.newtitle = cuni('Gr\u00e4mps T\u00e9st') os.makedirs(self.newpath) + self.old_path = getconfig('behavior.database-path') setconfig('behavior.database-path', self.newpath) self.cli = CLIDbManager(DbState()) def tearDown(self): + from gramps.gen.config import set as setconfig for (dirpath, dirnames, filenames) in os.walk(self.newpath, False): for afile in filenames: os.remove(os.path.join(dirpath, afile)) for adir in dirnames: os.rmdir(os.path.join(dirpath, adir)) os.rmdir(self.newpath) - pass + setconfig('behavior.database-path', self.old_path) # Test that clidbman will open files in a path containing # arbitrary Unicode characters.