[py-svn] r63332 - py/extradoc/talk/pycon-us-2009/pytest-introduction
briandorsey at codespeak.net
briandorsey at codespeak.net
Thu Mar 26 04:33:45 CET 2009
Author: briandorsey
Date: Thu Mar 26 04:33:42 2009
New Revision: 63332
Modified:
py/extradoc/talk/pycon-us-2009/pytest-introduction/pytest-introduction.html
py/extradoc/talk/pycon-us-2009/pytest-introduction/pytest-introduction.txt
Log:
various fixes and changes after walkthrough with Holger.
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 Thu Mar 26 04:33:42 2009
@@ -341,7 +341,7 @@
<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-plugins-and-funcargs">using plugins and funcargs</a></li>
+<li><a class="reference internal" href="#using-plugins">using plugins</a></li>
<li><a class="reference internal" href="#wrap-up-questions">wrap up & questions</a></li>
</ul>
</div>
@@ -354,39 +354,35 @@
<h1>motivation</h1>
<p><em>why automated testing? (about 10 minutes)</em></p>
<ul class="simple">
-<li>what is unit testing and how does it compare to other types of testing</li>
<li>focusing mostly on unit testing (small tests) in this tutorial</li>
-<li>why do automated testing? benefits, etc</li>
-<li>existing python testing tools</li>
</ul>
-<p>TODO: split</p>
-<p>(steal some from Titus: <a class="reference external" href="http://ivory.idyll.org/articles/nose-intro.html">http://ivory.idyll.org/articles/nose-intro.html</a>)</p>
</div>
-<div class="slide" id="why-test-driven-development">
-<h1>why test driven development?</h1>
+<div class="slide" id="why-do-automated-testing">
+<h1>why do automated testing?</h1>
<ul class="simple">
-<li>make sure code does the right thing</li>
-<li>make sure changes don't break expected behaviour</li>
-<li>incremental work style</li>
-<li>faster develpment</li>
-<li>easier maintenance</li>
-<li>better than static types :)</li>
+<li>make sure the code works as advertised</li>
+<li>make sure changes don't break existing behaviour</li>
+<li>make sure bugs don't come back silently</li>
+<li>leads to faster development and easier maintenance</li>
</ul>
</div>
-<div class="slide" id="tdd-spectrum">
-<h1>TDD spectrum</h1>
+<div class="slide" id="test-driven-development">
+<h1>Test driven development</h1>
+<ul class="simple">
+<li>There is some religion around Test Driven Development.</li>
+</ul>
+</div>
+<div class="slide" id="pragmatism">
+<h1>Pragmatism</h1>
<p><em>"I don't do test-driven development; I do stupidity-driven testing. When I do something stupid, I write a test to make sure I don't do it again."</em> - Titus Brown</p>
<ul class="simple">
-<li>Full Test Driven Development</li>
-<li>Stupidity Driven Testing</li>
-<li>Happy path testing</li>
+<li>I do Happy Path testing - kind of minimal TDD + SDD.</li>
</ul>
</div>
<div class="slide" id="what-you-get-with-py-test">
<h1>what you get with py.test</h1>
<p><em>The fundamental features of py.test (about 10 minutes)</em></p>
<ul class="simple">
-<li>a good tool for test-driven development!</li>
<li>no boilerplate: write tests rapidly</li>
<li>run all or subsets of tests</li>
<li>lots of useful information when a test fails</li>
@@ -452,6 +448,13 @@
can leave your debugging print statments in place to help your future
self.</p>
</div>
+<div class="slide" id="less-boilerplate">
+<h1>less boilerplate</h1>
+<p>py.test uses naming conventions to reduce boilerplate registration code.</p>
+<ul class="simple">
+<li>TestSuite discovery story</li>
+</ul>
+</div>
<div class="slide" id="simplicity">
<h1>simplicity</h1>
<p>All of these features simplfy writing your tests.</p>
@@ -726,10 +729,15 @@
<li>generative tests</li>
</ul>
</div>
-<div class="slide" id="using-plugins-and-funcargs">
-<h1>using plugins and funcargs</h1>
-<p><em>Overview of using plugins and funcargs (25 minutes)</em></p>
-<p>TODO: content from holger</p>
+<div class="slide" id="using-plugins">
+<h1>using plugins</h1>
+<p><em>Overview of using plugins (25 minutes)</em></p>
+<ul class="simple">
+<li>unittest</li>
+<li>doctests</li>
+<li>pocoo</li>
+</ul>
+<p>TODO: split</p>
</div>
<div class="slide" id="wrap-up-questions">
<h1>wrap up & questions</h1>
@@ -746,7 +754,8 @@
<p>TODO:
- add simple demo early on - what it looks like to run py.test from the command line.
- give overview of what's going on when you run py.test - collection, running, etc
-- add py.test.mark to -k slide - if it works</p>
+- add py.test.mark to -k slide - if it works
+- can we get --nocapture back?</p>
</div>
</div>
</body>
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 Thu Mar 26 04:33:42 2009
@@ -23,7 +23,7 @@
- `break`_
- `options`_ (w/exercise)
- `branching out`_ (w/exercise)
-- `using plugins and funcargs`_
+- `using plugins`_
- `wrap up & questions`_
@@ -35,40 +35,44 @@
Holger Krekel <holger at merlinux.eu> - lead developer of py.test.
+You
+===
+
+- Who are you?
+
+.. class:: handout
+
+ Python background
+ Testing background
+ python testing libraries: unitest, nose, py.test...
+
+
motivation
==========
*why automated testing? (about 10 minutes)*
-- what is unit testing and how does it compare to other types of testing
- focusing mostly on unit testing (small tests) in this tutorial
-- why do automated testing? benefits, etc
-- existing python testing tools
-
-TODO: split
-
-(steal some from Titus: http://ivory.idyll.org/articles/nose-intro.html)
+TODO - add small medium large slides
why do automated testing?
=========================
-- make sure code does the right thing
-- make sure changes don't break expected behaviour
-- incremental work style
-- faster develpment
-- easier maintenance
-- better than static types :)
+- make sure the code works as advertised
+- make sure changes don't break existing behaviour
+- make sure bugs don't come back silently
+- leads to faster development and easier maintenance
Test driven development
=======================
-- Write each test before the code.
+- There is some religion around Test Driven Development.
-Pragmatic
-=========
+Pragmatism
+==========
*"I don't do test-driven development; I do stupidity-driven testing. When I do something stupid, I write a test to make sure I don't do it again."* - Titus Brown
@@ -78,34 +82,36 @@
what you get with py.test
=========================
+TODO - title wording
*The fundamental features of py.test (about 10 minutes)*
-- a good tool for test-driven development!
- no boilerplate: write tests rapidly
- run all or subsets of tests
- lots of useful information when a test fails
-function or class
-=================
+how it starts
+=============
-::
+$ py.test
- def test_something():
- assert True
+(DEMO)
- class TestSomething():
- def test_something(self):
- assert True
+automatic test discovery
+========================
+
+search all test_* and *_test files
+
.. class:: handout
- Use individual test functions or group tests in classes. Use whichever
- makes the most sense for each test or group of tests.
+ py.test searches for all modules which start with `test_` or end with
+ `_test`. Within those modules, it collects all functions and methods which
+ start with `test_`.
-automatic test discovery
-========================
+function or class
+=================
::
@@ -116,13 +122,10 @@
def test_something(self):
assert True
- # search all test_* and *_test files
-
.. class:: handout
- py.test searches for all modules which start with `test_` or end with
- `_test`. Within those modules, it collects all functions and methods which
- start with `test_`.
+ Use individual test functions or group tests in classes. Use whichever
+ makes the most sense for each test or group of tests.
assert introspection
@@ -154,11 +157,13 @@
print "Useful debugging information."
assert True
- @py.test.mark(xfail="Expected failure.")
+ @py.test.mark.xfail("Expected failure.")
def test_something2():
print "Useful debugging information."
assert False
+TODO: fix all xfail s
+
.. class:: handout
stdout is captured for each test, and only printed if the test fails. You
@@ -166,10 +171,18 @@
self.
+less boilerplate
+================
+
+py.test uses naming conventions to reduce boilerplate registration code.
+
+- TestSuite discovery story
+
+
simplicity
==========
-All of these features simplfy writing your tests.
+All of these features simplify writing your tests.
and many more
@@ -254,6 +267,9 @@
- working with failures - debug with print
- bonus: exceptions
+todo add slides on asserts and another on raises
+
+
exercise 2 (~10 min)
=====================
@@ -483,12 +499,16 @@
- generative tests
-using plugins and funcargs
-==========================
+using plugins
+=============
+
+*Overview of using plugins (25 minutes)*
-*Overview of using plugins and funcargs (25 minutes)*
+- unittest
+- doctests
+- pocoo
-TODO: content from holger
+TODO: split
wrap up & questions
More information about the pytest-commit
mailing list