Arve Knudsen avatar Arve Knudsen committed 8d8bd82

Adhere to nose2 style

Comments (0)

Files changed (1)

nose2/tests/test_doctests.py

 
     def test___init__(self):
         """Test the __init__ method."""
-        plug = self.__create()
+        plug = self._create()
 
         self.assertEqual(plug.extensions, ['.txt', '.rst'])
 
 >>> 2 == 2
 True
 """
-        txt_event = self.__handle_file('docs.txt', doc_test)
-        rst_event = self.__handle_file('docs.rst', doc_test)
+        txt_event = self._handle_file('docs.txt', doc_test)
+        rst_event = self._handle_file('docs.rst', doc_test)
         # Excercise loading of doctests from Python code
-        py_event = self.__handle_file('docs.py', """\
+        py_event = self._handle_file('docs.py', """\
 \"\"\"
 >>> 2 == 2
 True
 
     def test_handle_file_python_without_doctests(self):
         """Test calling handleFile for a Python module without doctests."""
-        event = self.__handle_file("mod.py", """\
+        event = self._handle_file("mod.py", """\
 def func():
     pass
 """)
         self.assertEqual(event.extraTests, [])
 
 
-    def __handle_file(self, fpath, content):
+    def _handle_file(self, fpath, content):
         """Have plugin handle a file with certain content.
 
         The file is created, then a plugin is instantiated and its handleFile
         method is called for the file.
         """
-        plug = self.__create()
+        plug = self._create()
         fh = open(fpath, "wb")
         try:
             fh.write(content)
         return event
 
 
-    def __create(self):
+    def _create(self):
         """Create a DocTestLoader instance."""
         plug = doctests.DocTestLoader()
         return plug
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.