[py-svn] r63167 - py/extradoc/talk/pycon-us-2009/pytest-introduction

briandorsey at codespeak.net briandorsey at codespeak.net
Sat Mar 21 07:40:33 CET 2009


Author: briandorsey
Date: Sat Mar 21 07:40:31 2009
New Revision: 63167

Modified:
   py/extradoc/talk/pycon-us-2009/pytest-introduction/pytest-introduction.html
   py/extradoc/talk/pycon-us-2009/pytest-introduction/pytest-introduction.txt
Log:
added TOC links
fleshed out options section


Modified: py/extradoc/talk/pycon-us-2009/pytest-introduction/pytest-introduction.html
==============================================================================
--- py/extradoc/talk/pycon-us-2009/pytest-introduction/pytest-introduction.html	(original)
+++ py/extradoc/talk/pycon-us-2009/pytest-introduction/pytest-introduction.html	Sat Mar 21 07:40:31 2009
@@ -335,15 +335,15 @@
 <div class="slide" id="the-plan">
 <h1>the plan</h1>
 <ul class="simple">
-<li>motivation</li>
-<li>what you get with py.test</li>
-<li>installation (w/exercise)</li>
-<li>basic usage (w/exercise)</li>
-<li>break</li>
-<li>options (w/exercise)</li>
-<li>branching out (w/exercise)</li>
-<li>using doctests (w/exercise)</li>
-<li>wrap up & questions</li>
+<li><a class="reference internal" href="#motivation">motivation</a></li>
+<li><a class="reference internal" href="#what-you-get-with-py-test">what you get with py.test</a></li>
+<li><a class="reference internal" href="#installation">installation</a> (w/exercise)</li>
+<li><a class="reference internal" href="#basic-usage">basic usage</a> (w/exercise)</li>
+<li><a class="reference internal" href="#break">break</a></li>
+<li><a class="reference internal" href="#options">options</a> (w/exercise)</li>
+<li><a class="reference internal" href="#branching-out">branching out</a> (w/exercise)</li>
+<li><a class="reference internal" href="#using-doctests">using doctests</a> (w/exercise)</li>
+<li><a class="reference internal" href="#wrap-up-questions">wrap up & questions</a></li>
 </ul>
 </div>
 <div class="slide" id="motivation">
@@ -500,7 +500,7 @@
 </div>
 <div class="slide" id="basic-usage">
 <h1>basic usage</h1>
-<p>Basic usage of py.test (40 minutes)</p>
+<p><em>Basic usage of py.test (40 minutes)</em></p>
 <ul class="simple">
 <li>reinterpretation of asserts</li>
 <li>working with failures - debug with print</li>
@@ -518,7 +518,6 @@
 <li>reinterpretation of asserts</li>
 <li>working with failures - debug with print</li>
 <li>bonus: exceptions</li>
-<li>10 minute work time - exercise</li>
 </ul>
 </div>
 <div class="slide" id="exercise-2-10-min">
@@ -547,7 +546,6 @@
 <ul class="simple">
 <li>test classes</li>
 <li>setup and teardown test state (special methods / funcargs)</li>
-<li>10 minute work time - exercise</li>
 </ul>
 </div>
 <div class="slide" id="exercise-3-10-min">
@@ -572,22 +570,100 @@
 </div>
 <div class="slide" id="options">
 <h1>options</h1>
-<p>Options (25 minutes)</p>
-<ul class="simple">
-<li>--exitfirst</li>
-<li>--nocapture</li>
-<li>--showlocals</li>
-<li>--looponfailing - run large test set until all tests pass</li>
-<li>-k - to run tests matching name or keyword</li>
-<li>--exec - to use different Python interpreters</li>
+<pre class="literal-block">
+$ py.test --help
+usage: py.test [options] [file_or_dir] [file_or_dir] [...]
+
+options:
+-h, --help            show this help message and exit
+
+misc:
+    --resultlog=RESULTLOG
+                        path for machine-readable result log
+    --collectonly       only collect tests, don't execute them.
+...
+</pre>
+<pre class="handout literal-block">
+general:
+    -v, --verbose       increase verbosity.
+    -x, --exitfirst     exit instantly on first error or failed test.
+    -s, --nocapture     disable catching of sys.stdout/stderr output.
+    -k KEYWORD          only run test items matching the given space separated
+                        keywords.  precede a keyword with '-' to negate.
+                        Terminate the expression with ':' to treat a match as
+                        a signal to run all subsequent tests.
+    -l, --showlocals    show locals in tracebacks (disabled by default).
+    --showskipsummary   always show summary of skipped testse work time - exercise
+    --pdb               start pdb (the Python debugger) on errors.
+    --tb=TBSTYLE        traceback verboseness (long/short/no).
+    --fulltrace         don't cut any tracebacks (default is to cut).
+    --nomagic           refrain from using magic as much as possible.
+    --traceconfig       trace considerations of conftest.py files.
+    -f, --looponfailing
+                        loop on failing test set.
+    --exec=EXECUTABLE   python executable to run the tests with.
+    -n NUMPROCESSES, --numprocesses=NUMPROCESSES
+                        number of local test processes.
+    --debug             turn on debugging information.
+
+experimental:
+    -d, --dist          ad-hoc distribute tests across machines (requires
+                        conftest settings)
+    -w, --startserver   starts local web server for displaying test progress.
+    -r, --runbrowser    run browser (implies --startserver).
+    --boxed             box each test run in a separate process
+    --rest              restructured text output reporting.
+</pre>
+</div>
+<div class="slide" id="selected-options">
+<h1>selected options</h1>
+<p><em>Options (25 minutes)</em></p>
+<ul class="simple">
+<li>--nocapture - disable catching of sys.stdout/stderr output.</li>
+<li>--exitfirst (*) - exit instantly on first error or failed test.</li>
+<li>--showlocals (*) - show locals in tracebacks.</li>
+<li>--looponfailing (*) - loop on failing test set.</li>
+<li>-k (*) - only run test items matching the given keyword.</li>
+<li>--exec (*) - python executable to run the tests with.</li>
 <li>--tb/fulltrace - different options to control traceback generation</li>
-<li>10 minute work time - exercises</li>
 </ul>
-<p>TODO: split</p>
+<p>(*) more detail in advanced tutorial</p>
+</div>
+<div class="slide" id="demo-nocapture">
+<h1>demo: --nocapture</h1>
+<p>TODO: write demo script</p>
+</div>
+<div class="slide" id="demo-exitfirst">
+<h1>demo: --exitfirst</h1>
+<p>TODO: write demo script</p>
+</div>
+<div class="slide" id="demo-showlocals">
+<h1>demo: --showlocals</h1>
+<p>TODO: write demo script</p>
+</div>
+<div class="slide" id="demo-k">
+<h1>demo: -k</h1>
+<p>TODO: write demo script</p>
+</div>
+<div class="slide" id="exercise-4-20-min">
+<h1>exercise 4  (~20 min)</h1>
+<ul class="simple">
+<li>--nocapture - disable catching of sys.stdout/stderr output.</li>
+<li>--exitfirst (*) - exit instantly on first error or failed test.</li>
+<li>--showlocals (*) - show locals in tracebacks.</li>
+<li>--looponfailing (*) - loop on failing test set.</li>
+<li>-k (*) - only run test items matching the given keyword.</li>
+<li>--exec (*) - python executable to run the tests with.</li>
+<li>--tb/fulltrace - different options to control traceback generation</li>
+</ul>
+<p class="handout">Experiment with a few of these options, ask questions and play.</p>
+<p class="handout">If you're in the advanced class this afternoon. Think about other options
+you'd like. Maybe we can make a plugin.</p>
+<p class="handout">TODO: check with holger - time to make a plugin?</p>
 </div>
 <div class="slide" id="branching-out">
 <h1>branching out</h1>
-<p>Branching out (20 minutes)</p>
+<p><em>Branching out (20 minutes)</em></p>
 <ul class="simple">
 <li>skipping tests</li>
 <li>generative tests</li>
@@ -598,7 +674,7 @@
 </div>
 <div class="slide" id="using-doctests">
 <h1>using doctests</h1>
-<p>Using doctests (25 minutes)</p>
+<p><em>Using doctests (25 minutes)</em></p>
 <ul class="simple">
 <li>what are doctests</li>
 <li>two usage scenarios - docstrings & stand alone files</li>
@@ -609,7 +685,7 @@
 </div>
 <div class="slide" id="wrap-up-questions">
 <h1>wrap up & questions</h1>
-<p>Wrapping up and questions (20 minutes)</p>
+<p><em>Wrapping up and questions (20 minutes)</em></p>
 <ul class="simple">
 <li>where to go from here</li>
 <li>quesitons and student topics</li>

Modified: py/extradoc/talk/pycon-us-2009/pytest-introduction/pytest-introduction.txt
==============================================================================
--- py/extradoc/talk/pycon-us-2009/pytest-introduction/pytest-introduction.txt	(original)
+++ py/extradoc/talk/pycon-us-2009/pytest-introduction/pytest-introduction.txt	Sat Mar 21 07:40:31 2009
@@ -28,15 +28,15 @@
 the plan
 ========
 
-- motivation
-- what you get with py.test
-- installation (w/exercise)
-- basic usage (w/exercise)
-- break
-- options (w/exercise)
-- branching out (w/exercise)
-- using doctests (w/exercise)
-- wrap up & questions
+- `motivation`_
+- `what you get with py.test`_
+- `installation`_ (w/exercise)
+- `basic usage`_ (w/exercise)
+- `break`_
+- `options`_ (w/exercise)
+- `branching out`_ (w/exercise)
+- `using doctests`_ (w/exercise)
+- `wrap up & questions`_
 
 
 motivation
@@ -229,7 +229,7 @@
 basic usage
 ===========
 
-Basic usage of py.test (40 minutes)
+*Basic usage of py.test (40 minutes)*
 
 - reinterpretation of asserts 
 - working with failures - debug with print
@@ -306,24 +306,120 @@
 options
 =======
 
-Options (25 minutes)
+::
+ 
+    $ py.test --help
+    usage: py.test [options] [file_or_dir] [file_or_dir] [...]
 
-- --exitfirst
-- --nocapture
-- --showlocals
-- --looponfailing - run large test set until all tests pass 
-- -k - to run tests matching name or keyword 
-- --exec - to use different Python interpreters 
-- --tb/fulltrace - different options to control traceback generation
-- 10 minute work time - exercises
+    options:
+    -h, --help            show this help message and exit
+
+    misc:
+        --resultlog=RESULTLOG
+                            path for machine-readable result log
+        --collectonly       only collect tests, don't execute them.
+    ...
+
+
+.. class:: handout
+
+::
+
+    general:
+        -v, --verbose       increase verbosity.
+        -x, --exitfirst     exit instantly on first error or failed test.
+        -s, --nocapture     disable catching of sys.stdout/stderr output.
+        -k KEYWORD          only run test items matching the given space separated
+                            keywords.  precede a keyword with '-' to negate.
+                            Terminate the expression with ':' to treat a match as
+                            a signal to run all subsequent tests.
+        -l, --showlocals    show locals in tracebacks (disabled by default).
+        --showskipsummary   always show summary of skipped testse work time - exercise
+        --pdb               start pdb (the Python debugger) on errors.
+        --tb=TBSTYLE        traceback verboseness (long/short/no).
+        --fulltrace         don't cut any tracebacks (default is to cut).
+        --nomagic           refrain from using magic as much as possible.
+        --traceconfig       trace considerations of conftest.py files.
+        -f, --looponfailing
+                            loop on failing test set.
+        --exec=EXECUTABLE   python executable to run the tests with.
+        -n NUMPROCESSES, --numprocesses=NUMPROCESSES
+                            number of local test processes.
+        --debug             turn on debugging information.
+
+    experimental:
+        -d, --dist          ad-hoc distribute tests across machines (requires
+                            conftest settings)
+        -w, --startserver   starts local web server for displaying test progress.
+        -r, --runbrowser    run browser (implies --startserver).
+        --boxed             box each test run in a separate process
+        --rest              restructured text output reporting.
+
+
+selected options
+================
+
+*Options (25 minutes)*
+
+- --nocapture - disable catching of sys.stdout/stderr output.
+- --exitfirst (*) - exit instantly on first error or failed test.
+- --showlocals (*) - show locals in tracebacks.
+- --looponfailing (*) - loop on failing test set.
+- -k (*) - only run test items matching the given keyword.
+- --exec (*) - python executable to run the tests with.
+- --tb/fulltrace - different options to control traceback generation.
+
+(*) more detail in advanced tutorial
+
+demo: --nocapture
+=================
+
+TODO: write demo script
+
+
+demo: --exitfirst
+=================
+
+TODO: write demo script
+
+
+demo: --showlocals
+==================
+
+TODO: write demo script
+
+
+demo: -k
+========
+
+TODO: write demo script
+
+
+exercise 4  (~10 min)
+=====================
+
+- --nocapture - disable catching of sys.stdout/stderr output.
+- --exitfirst (*) - exit instantly on first error or failed test.
+- --showlocals (*) - show locals in tracebacks.
+- --looponfailing (*) - loop on failing test set.
+- -k (*) - only run test items matching the given keyword.
+- --exec (*) - python executable to run the tests with.
+- --tb/fulltrace - different options to control traceback generation.
+
+.. class:: handout
+
+    Experiment with a few of these options, ask questions and play. 
+
+    If you're in the advanced class this afternoon. Think about other options
+    you'd like. Maybe we can make a plugin. 
+
+    TODO: check with holger - time to make a plugin? 
 
-TODO: split
 
- 
 branching out
 =============
 
-Branching out (20 minutes)
+*Branching out (20 minutes)*
 
 - skipping tests
 - generative tests
@@ -336,7 +432,7 @@
 using doctests
 ==============
 
-Using doctests (25 minutes)
+*Using doctests (25 minutes)*
 
 - what are doctests
 - two usage scenarios - docstrings & stand alone files
@@ -349,7 +445,7 @@
 wrap up & questions
 ===================
 
-Wrapping up and questions (20 minutes)
+*Wrapping up and questions (20 minutes)*
 
 - where to go from here
 - quesitons and student topics



More information about the pytest-commit mailing list