From f70df32d6dd68dca4882c1718ed3b4447b5a7089 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 12 Nov 2015 11:16:41 +0100 Subject: [PATCH] Use files.chdir --- test/test_chordpro/test_parser.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/test_chordpro/test_parser.py b/test/test_chordpro/test_parser.py index 6834af4b..692eaa28 100644 --- a/test/test_chordpro/test_parser.py +++ b/test/test_chordpro/test_parser.py @@ -47,10 +47,8 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): def chdir(): """Context to temporarry change current directory to this file directory """ - olddir = os.getcwd() - os.chdir(resource_filename(__name__, "")) - yield - os.chdir(olddir) + with files.chdir(resource_filename(__name__, "")): + yield def assertRender(self, base, destformat): # pylint: disable=invalid-name """Assert that `{base}.source` is correctly rendered in the `destformat`.