Commits

Jason Pellerin committed 5338ce9

Doc updates, some done some in progress

Comments (0)

Files changed (11)

+../functional_tests/doc_tests

doc/further_reading.rst

    doc_tests/test_multiprocess/multiprocess.rst
    doc_tests/test_restricted_plugin_options/restricted_plugin_options.rst
    doc_tests/test_selector_plugin/selector_plugin.rst
-   doc_tests/test_xunit_plugin/test_skips.rst
    doc_tests/test_allmodules/test_allmodules.rst
    more_info
 
 
   The multiprocess plugin enables splitting test runs across multiple
   processes. For some test suites, this can shorten run time tremendously.
-  See also: :doc:`doc_tests/test_multiprocess/multiprocess`  
+  See also: :doc:`doc_tests/test_multiprocess/multiprocess`.
 
 * :doc:`Log capture <plugins/logcapture>`
 
 * :doc:`Xunit <plugins/xunit>`
  
   The Xunit plugin produces a test result file in ant/junit xml format,
-  suitable for use with `hudson`_ and other continuous integration systems
+  suitable for use with `Hudson`_ and other continuous integration systems
   that consume this format.
 
 * :doc:`Collect only <plugins/collect>`
   This plugin enables collecting tests from all python modules, not just those
   that match testMatch.
   
-.. _`hudson` : https://hudson.dev.java.net/
+.. _`Hudson` : https://hudson.dev.java.net/
 
 Plugin improvements
 -------------------
 -------
 
 * **All new documentation!** nose's documentation is now generated by
-  Sphinx. And thanks to Pam Zerbinos, is much better organized and easier to
-  use and read.
+  Sphinx. And thanks to Pam Zerbinos, it is much better organized and easier
+  to use and read.
 
 * Two new core commandline options can help with testing namespace
   packages. :option:`--first-package-wins` is useful when you want to test one
   plugin, only makes it available to be enabled via command-line or
   config file settings.
 
-* Experimental IronPython support
-
-  Thanks to Kevin Mitchell, nose is now more compatible with
+* Thanks to Kevin Mitchell, nose is now more compatible with
   IronPython. IronPython is still not fully supported, but it should work. If
   you'd like to improve nose's support for IronPython further, please join the
   `nose developer's list`_ and volunteer to become the IronPython maintainer for

functional_tests/doc_tests/test_doctest_fixtures/doctest_fixtures.rst

 Doctest Fixtures
 ----------------
 
+FIXME blah blah FIXME
+
+.. include :: doctest_fixtures_fixtures.py
+   :literal:
+
+FIXME examples
+   
+    >>> something
+    'Something?'
+    
+    >>> 1
+    1
+    >>> count
+    1
+
+This whole file is one doctest test. setup_test doesn't do what you think!
+It exists to give you access to the test case and examples, but it runs
+*once*, before all of them, not before each.
+
+    >>> count
+    1
+
+   
 Fixtures for a doctest file may define any or all of the following methods:
 
 setup/setup_module/setupModule/setUpModule (module)
       test.globs['count'] = len(called)
   setup_test.__test__ = False
       
-    >>> 1
-    1
 
 This is another example.
 
-    >>> count
-    1
 
 And this is yet another example.
 
-    >>> count
-    1
 
 teardown_test(test)
 ===================
 globs(globs)
 ============
 
-    >>> something
-    'Something?'
 
 
 

functional_tests/doc_tests/test_issue097/plugintest_environment.rst

 can test the cases where that is used as the default.
 
     >>> old_config = nose.config.Config
-
     >>> class PrintArgvConfig(old_config):
     ...
     ...     def configure(self, argv=None, doc=None):
     ...         print "argv:", argv
     ...         old_config.configure(self, argv, doc)
-
     >>> nose.config.Config = PrintArgvConfig
 
 The class under test, PluginTester, is designed to be used by
     ...    def makeSuite(self):
     ...        return unittest.TestSuite(tests=[])
 
-
 For the purposes of this test, we need a known ``os.environ`` and
 ``sys.argv``.
 
 
     >>> class EmptyEnvTester(Tester):
     ...    env = {}
-
     >>> tester = EmptyEnvTester()
     >>> tester.setUp()
     argv: ['nosetests', '-v']
 
     >>> class NonEmptyEnvTester(Tester):
     ...    env = {"foo": "bar"}
-
     >>> tester = NonEmptyEnvTester()
     >>> tester.setUp()
     argv: ['nosetests', '-v']
 ``nose.plugins.plugintest.run()`` should work analogously.
 
     >>> from nose.plugins.plugintest import run_buffered as run
-
     >>> run(suite=unittest.TestSuite(tests=[]),
     ...     plugins=[PrintEnvPlugin()]) # doctest: +REPORT_NDIFF
     argv: ['nosetests', '-v']
     Ran 0 tests in ...s
     <BLANKLINE>
     OK
-
     >>> run(env={},
     ...     suite=unittest.TestSuite(tests=[]),
     ...     plugins=[PrintEnvPlugin()]) # doctest: +REPORT_NDIFF
     Ran 0 tests in ...s
     <BLANKLINE>
     OK
-
     >>> run(env={"foo": "bar"},
     ...     suite=unittest.TestSuite(tests=[]),
     ...     plugins=[PrintEnvPlugin()]) # doctest: +REPORT_NDIFF
 An explicit config parameter with an env is honoured:
 
     >>> from nose.plugins.manager import PluginManager
-
     >>> manager = PluginManager(plugins=[PrintEnvPlugin()])
     >>> config = PrintArgvConfig(env={"foo": "bar"}, plugins=manager)
     >>> run(config=config,

functional_tests/doc_tests/test_issue107/plugin_exceptions.rst

     ...     def configure(self, options, conf):
     ...         pass
     ...     def options(self, parser, env={}):
-    ...         pass
-
+    ...         pass    
     >>> class FailBeforePlugin(EnabledPlugin):
     ...     name = "fail-before"
     ...	    
     ...     def beforeTest(self, test):
-    ...         raise AttributeError()
-
+    ...         raise AttributeError()    
     >>> class FailAfterPlugin(EnabledPlugin):
     ...     name = "fail-after"
     ...	    
 
     >>> support = os.path.join(os.path.dirname(__file__), 'support')
     >>> suitepath = os.path.join(support, 'test_spam.py')
-
     >>> run(argv=['nosetests', suitepath],
     ...     plugins=[FailBeforePlugin()])
     EE
     ...     
     ...     def prepareTestLoader(self, loader):
     ...         raise TypeError("That loader is not my type")
-
     >>> run(argv=['nosetests', suitepath],
     ...     plugins=[FailPreparationPlugin()])
     Traceback (most recent call last):
     ...         if False:
     ...             yield None
     ...         raise TypeError("bug in plugin")
-
     >>> run(argv=['nosetests', suitepath],
     ...     plugins=[FailLoadPlugin()])
     ..E
     ...         if False:
     ...             yield None
     ...         raise TypeError("bug in plugin")
-
     >>> run(argv=['nosetests', suitepath],
     ...     plugins=[FailLoadFromNamePlugin()])
     E

functional_tests/doc_tests/test_issue119/empty_plugin.rst

     ...
     ...     def configure(self, options, conf):
     ...         pass
-
     >>> import unittest
     >>> from nose.plugins.plugintest import run_buffered as run
-
     >>> run(suite=unittest.TestSuite(tests=[]),
     ...     plugins=[NullPlugin()]) # doctest: +REPORT_NDIFF
     ----------------------------------------------------------------------
 
     >>> import os
     >>> from nose.plugins import Plugin
-
     >>> class DerivedNullPlugin(Plugin):
     ...
     ...     name = "derived-null"
     ...         if not self.can_configure:
     ...             return
     ...         self.conf = conf
-
     >>> run(suite=unittest.TestSuite(tests=[]),
     ...     plugins=[DerivedNullPlugin(), EnabledDerivedNullPlugin()])
     ...     # doctest: +REPORT_NDIFF

functional_tests/doc_tests/test_issue142/errorclass_failure.rst

 
     >>> import os
     >>> import sys
-
     >>> from nose.plugins.plugintest import run_buffered as run
     >>> from nose.plugins.skip import Skip
     >>> from nose.plugins.deprecated import Deprecated
-
     >>> support = os.path.join(os.path.dirname(__file__), 'support')
     >>> sys.path.insert(0, support)
-
     >>> from errorclass_failure_plugin import Todo, TodoPlugin, \
     ...                                       NonFailureTodoPlugin
-
     >>> todo_test = os.path.join(support, 'errorclass_failing_test.py')
     >>> misc_test = os.path.join(support, 'errorclass_tests.py')
 

functional_tests/doc_tests/test_issue145/imported_tests.rst

     ----------------------------------------------------------------------
     Ran 1 test in ...s
     <BLANKLINE>
-    OK
-    
+    OK    
     >>> argv = [__file__, '-v', os.path.join(support, 'package2c')]
     >>> run(argv=argv) # doctest: +REPORT_NDIFF
     package2c setup

functional_tests/doc_tests/test_multiprocess/multiprocess.rst

 
 .. Note ::
 
-   FIXME: note about run()
+   The run() function in :mod:`nose.plugins.plugintest` reformats test result
+   output to remove timings, which will vary from run to run, and
+   redirects the output to stdout.
+
+    >>> from nose.plugins.plugintest import run_buffered as run
 
 ..
 
     >>> import os
-    >>> from nose.plugins.plugintest import run_buffered as run
     >>> support = os.path.join(os.path.dirname(__file__), 'support')
     >>> test_not_shared = os.path.join(support, 'test_not_shared.py')
     >>> test_shared = os.path.join(support, 'test_shared.py')
     >>> test_can_split = os.path.join(support, 'test_can_split.py')
 
+The module with shared fixtures passes.
+    
     >>> run(argv=['nosetests', '-v', test_shared]) #doctest: +REPORT_NDIFF
     setup called
     test_shared.TestMe.test_one ... ok
     <BLANKLINE>
     OK
 
+As does the module with no fixture annotations.
+    
     >>> run(argv=['nosetests', '-v', test_not_shared]) #doctest: +REPORT_NDIFF
     setup called
     test_not_shared.TestMe.test_one ... ok
     <BLANKLINE>
     OK
 
+And the module that marks its fixtures as re-entrant.
+    
     >>> run(argv=['nosetests', '-v', test_can_split]) #doctest: +REPORT_NDIFF
     setup called
     test_can_split.TestMe.test_one ... ok
 any use of the multiprocess plugin, the order in which the tests execute is
 indeterminate.
 
-    # First we have to reset all of the test modules
+First we have to reset all of the test modules.
+
     >>> import sys
     >>> sys.modules['test_shared'].called[:] = []
     >>> sys.modules['test_not_shared'].called[:] = []
     >>> sys.modules['test_can_split'].called[:] = []
 
+Then we can run the tests again with the multiprocess plugin active.
+    
     >>> run(argv=['nosetests', '-v', '--processes=2', test_shared],
     ...     plugins=[MultiProcess()]) #doctest: +ELLIPSIS
     setup called
 marked `_multiprocess_can_split_`, or tests will fail in one or more
 runner processes as fixtures are re-executed.
 
+We have to reset all of the test modules again.
+
+    >>> import sys
+    >>> sys.modules['test_shared'].called[:] = []
+    >>> sys.modules['test_not_shared'].called[:] = []
+    >>> sys.modules['test_can_split'].called[:] = []
+
+Then we can run again and see the failures.
+
     >>> run(argv=['nosetests', '-v', '--processes=2', test_can_split],
     ...     plugins=[MultiProcess()]) #doctest: +ELLIPSIS
     test_can_split....

functional_tests/doc_tests/test_restricted_plugin_options/restricted_plugin_options.rst

 
 ..
 
-    When run with a normal plugin manager, the plugin executes.
+When run with a normal plugin manager, the plugin executes.
 
     >>> argv = ['plugintest', '-v', '--with-startplugin', support]
     >>> run(argv=argv, plugins=[StartPlugin()]) # doctest: +REPORT_NDIFF