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`.