Ned Batchelder  committed 99b9427

Some pylint cleanups.

  • Participants
  • Parent commits 0a2f56d

Comments (0)

Files changed (3)

File coverage/

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

File coverage/

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

File test/

 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("", "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")