diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2010-03-21 19:10:47 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2010-03-21 19:10:47 -0400 |
commit | d5eb792df1b6de46626230d5a135e0bbf569f361 (patch) | |
tree | 1b3e18eb33b7c2638f41309a89a2526168d5e99a /test/test_files.py | |
parent | 489872c0d84aeff03d164eda5201b495a73e129d (diff) | |
download | python-coveragepy-git-d5eb792df1b6de46626230d5a135e0bbf569f361.tar.gz |
Lint cleanup
Diffstat (limited to 'test/test_files.py')
-rw-r--r-- | test/test_files.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/test/test_files.py b/test/test_files.py index 4852d692..ca9b4e0d 100644 --- a/test/test_files.py +++ b/test/test_files.py @@ -10,25 +10,26 @@ from coveragetest import CoverageTest class FileLocatorTest(CoverageTest): """Tests of `FileLocator`.""" - + def abs_path(self, p): + """Return the absolute path for `p`.""" return os.path.join(os.getcwd(), os.path.normpath(p)) def test_simple(self): self.make_file("hello.py", "#hello") fl = FileLocator() self.assertEqual(fl.relative_filename("hello.py"), "hello.py") - abs = self.abs_path("hello.py") - self.assertNotEqual(abs, "hello.py") - self.assertEqual(fl.relative_filename(abs), "hello.py") + a = self.abs_path("hello.py") + self.assertNotEqual(a, "hello.py") + self.assertEqual(fl.relative_filename(a), "hello.py") def test_peer_directories(self): self.make_file("sub/proj1/file1.py", "file1") self.make_file("sub/proj2/file2.py", "file2") - abs1 = self.abs_path("sub/proj1/file1.py") - abs2 = self.abs_path("sub/proj2/file2.py") + a1 = self.abs_path("sub/proj1/file1.py") + a2 = self.abs_path("sub/proj2/file2.py") d = os.path.normpath("sub/proj1") os.chdir(d) fl = FileLocator() - self.assertEqual(fl.relative_filename(abs1), "file1.py") - self.assertEqual(fl.relative_filename(abs2), abs2) + self.assertEqual(fl.relative_filename(a1), "file1.py") + self.assertEqual(fl.relative_filename(a2), a2) |