diff --git a/test/test_vim.py b/test/test_vim.py index 7618f7b9..88e683c0 100644 --- a/test/test_vim.py +++ b/test/test_vim.py @@ -21,8 +21,8 @@ def test_command(): vim.command('normal itesting\npython\napi') vim.command('w') ok(os.path.isfile(fname)) - eq(open(fname).read(), 'testing\npython\napi\n') - os.unlink(fname) + with open(fname) as f: + eq(f.read(), 'testing\npython\napi\n') @with_setup @@ -63,8 +63,10 @@ def test_strwidth(): @with_setup(setup=cleanup) def test_chdir(): pwd = vim.eval('getcwd()') + root = os.path.abspath(os.sep) + # We can chdir to '/' on Windows, but then the pwd will be the root drive vim.chdir('/') - eq(vim.eval('getcwd()'), '/') + eq(vim.eval('getcwd()'), root) vim.chdir(pwd) eq(vim.eval('getcwd()'), pwd)