summaryrefslogtreecommitdiff
path: root/test/test_files.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2010-03-21 19:10:47 -0400
committerNed Batchelder <ned@nedbatchelder.com>2010-03-21 19:10:47 -0400
commitd5eb792df1b6de46626230d5a135e0bbf569f361 (patch)
tree1b3e18eb33b7c2638f41309a89a2526168d5e99a /test/test_files.py
parent489872c0d84aeff03d164eda5201b495a73e129d (diff)
downloadpython-coveragepy-git-d5eb792df1b6de46626230d5a135e0bbf569f361.tar.gz
Lint cleanup
Diffstat (limited to 'test/test_files.py')
-rw-r--r--test/test_files.py17
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)