Kumar McMillan avatar Kumar McMillan committed 4a2a24e

Examples are no longer doctests which makes them more readable. Also tightened up the prose while I was at it.
(transplanted from ae3911f83f5f30dd8e51e027a2ee0663813787ef)

Comments (0)

Files changed (1)

nose/plugins/attrib.py

 all tests except for the slow ones.  You can do this with the Attribute selector 
 plugin by setting attributes on your test methods.  Here is an example:
 
-    >>> def test_big_download():
-    ...     import urllib
-    ...     # commence slowness...
-    ... 
-    >>> test_big_download.slow = 1
+.. code-block:: python
+
+    def test_big_download():
+        import urllib
+        # commence slowness...
+    
+    test_big_download.slow = 1
 
 Once you've assigned an attribute ``slow = 1`` you can exclude that 
 test and all other tests having the slow attribute by running ::
 There is also a decorator available for you that will set attributes.  
 Here's how to set ``slow=1`` like above with the decorator:
 
-    >>> from nose.plugins.attrib import attr
-    >>> # @attr('slow')
-    ... def test_big_download():
-    ...     import urllib
-    ...     # commence slowness...
-    >>> test_big_download = attr('slow')(test_big_download)
+.. code-block:: python
+
+    from nose.plugins.attrib import attr
+    @attr('slow')
+    def test_big_download():
+        import urllib
+        # commence slowness...
 
 And here's how to set an attribute with a specific value :
 
-    >>> from nose.plugins.attrib import attr
-    >>> # @attr(speed='slow')
-    ... def test_big_download():
-    ...     import urllib
-    ...     # commence slowness...
-    >>> test_big_download = attr(speed='slow')(test_big_download)
+.. code-block:: python
 
+    from nose.plugins.attrib import attr
+    @attr(speed='slow')
+    def test_big_download():
+        import urllib
+        # commence slowness...
+
+This test could be run with ::
+    
+    $ nosetests -a speed=slow
+
+Below is a reference to the different syntaxes available.
 
 Simple syntax 
 -------------
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.