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
commita6061dd5f9f84d63c393761e35425ab3873f2f16 (patch)
tree4f226406f562ba9ba44780e35cbcf84a0efe45cc /test/test_files.py
parentd569d9b292cf882ed8d2c87312b4f1af48d1180d (diff)
downloadpython-coveragepy-a6061dd5f9f84d63c393761e35425ab3873f2f16.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 4852d69..ca9b4e0 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)