Commits

Ned Batchelder  committed 99b9427

Some pylint cleanups.

  • Participants
  • Parent commits 0a2f56d

Comments (0)

Files changed (3)

File coverage/backward.py

 # Python 3.2 provides `tokenize.open`, the best way to open source files.
 try:
     import tokenize
-    open_source = tokenize.open
+    open_source = tokenize.open     # pylint: disable=E1101
 except AttributeError:
     def open_source(fname):
         """Open a source file the best way."""

File coverage/results.py

         # Implementing 0+Numbers allows us to sum() a list of Numbers.
         if other == 0:
             return self
-        raise NotImplemented
+        return NotImplemented

File test/test_testing.py

 class CoverageTestTest(CoverageTest):
     """Test the methods in `CoverageTest`."""
 
+    def file_text(self, fname):
+        """Return the text read from a file."""
+        return open(fname, "rb").read().decode('ascii')
+
     def test_make_file(self):
         # A simple file.
         self.make_file("fooey.boo", "Hello there")
 
     def test_make_file_newline(self):
         self.make_file("unix.txt", "Hello\n")
-        self.assertEqual(open("unix.txt", "rb").read().decode('ascii'), "Hello\n")
+        self.assertEqual(self.file_text("unix.txt"), "Hello\n")
         self.make_file("dos.txt", "Hello\n", newline="\r\n")
-        self.assertEqual(open("dos.txt", "rb").read().decode('ascii'), "Hello\r\n")
+        self.assertEqual(self.file_text("dos.txt"), "Hello\r\n")
         self.make_file("mac.txt", "Hello\n", newline="\r")
-        self.assertEqual(open("mac.txt", "rb").read().decode('ascii'), "Hello\r")
+        self.assertEqual(self.file_text("mac.txt"), "Hello\r")