[py-svn] r63334 - in py/extradoc/talk/pycon-us-2009/pytest-introduction: . img
briandorsey at codespeak.net
briandorsey at codespeak.net
Thu Mar 26 04:54:14 CET 2009
Author: briandorsey
Date: Thu Mar 26 04:54:09 2009
New Revision: 63334
Added:
py/extradoc/talk/pycon-us-2009/pytest-introduction/img/
py/extradoc/talk/pycon-us-2009/pytest-introduction/img/large.png
- copied unchanged from r63333, py/extradoc/talk/pycon-us-2009/pytest-advanced/img/large.png
py/extradoc/talk/pycon-us-2009/pytest-introduction/img/medium.png
- copied unchanged from r63333, py/extradoc/talk/pycon-us-2009/pytest-advanced/img/medium.png
py/extradoc/talk/pycon-us-2009/pytest-introduction/img/small.png
- copied unchanged from r63333, py/extradoc/talk/pycon-us-2009/pytest-advanced/img/small.png
Modified:
py/extradoc/talk/pycon-us-2009/pytest-introduction/pytest-introduction.html
py/extradoc/talk/pycon-us-2009/pytest-introduction/pytest-introduction.txt
py/extradoc/talk/pycon-us-2009/pytest-introduction/test_examples.py
Log:
more updates based on 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:54:09 2009
@@ -334,8 +334,8 @@
<div class="slide" id="the-plan">
<h1>the plan</h1>
<ul class="simple">
-<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="#motivation-and-terms">motivation and terms</a></li>
+<li><a class="reference internal" href="#py-test-core-concepts">py.test core concepts</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>
@@ -345,17 +345,39 @@
<li><a class="reference internal" href="#wrap-up-questions">wrap up & questions</a></li>
</ul>
</div>
-<div class="slide" id="presenters">
-<h1>presenters</h1>
-<p>Brian Dorsey <<a class="reference external" href="mailto:brian@dorseys.org">brian@dorseys.org</a>> - enthusiastic user of py.test.</p>
-<p>Holger Krekel <<a class="reference external" href="mailto:holger@merlinux.eu">holger@merlinux.eu</a>> - lead developer of py.test.</p>
-</div>
-<div class="slide" id="motivation">
-<h1>motivation</h1>
-<p><em>why automated testing? (about 10 minutes)</em></p>
-<ul class="simple">
-<li>focusing mostly on unit testing (small tests) in this tutorial</li>
-</ul>
+<div class="slide" id="us">
+<h1>us</h1>
+<p>Brian Dorsey <<a class="reference external" href="mailto:brian@dorseys.org">brian@dorseys.org</a>></p>
+<p>enthusiastic user of py.test.</p>
+<p>Holger Krekel <<a class="reference external" href="mailto:holger@merlinux.eu">holger@merlinux.eu</a>></p>
+<p>lead developer of py.test.</p>
+</div>
+<div class="slide" id="you">
+<h1>you</h1>
+<p>Who are you?</p>
+<p class="handout">Python background
+Testing background
+python testing libraries: unitest, nose, py.test...</p>
+</div>
+<div class="slide" id="motivation-and-terms">
+<h1>motivation and terms</h1>
+<p><em>(about 10 minutes)</em></p>
+</div>
+<div class="slide" id="a-pragmatic-view-on-test-types">
+<h1>A pragmatic view on test types</h1>
+<p>let's talk about small, medium or large tests.</p>
+</div>
+<div class="slide" id="small-tests-one-aspect">
+<h1>Small Tests: one aspect</h1>
+<div align="center" class="align-center"><img alt="img/small.png" class="align-center" src="img/small.png" /></div>
+</div>
+<div class="slide" id="medium-tests-two-aspects">
+<h1>Medium Tests: two aspects</h1>
+<div align="center" class="align-center"><img alt="img/medium.png" class="align-center" src="img/medium.png" /></div>
+</div>
+<div class="slide" id="large-tests-three-more">
+<h1>Large Tests: three/more</h1>
+<div align="center" class="align-center"><img alt="img/large.png" class="align-center" src="img/large.png" /></div>
</div>
<div class="slide" id="why-do-automated-testing">
<h1>why do automated testing?</h1>
@@ -367,20 +389,20 @@
</ul>
</div>
<div class="slide" id="test-driven-development">
-<h1>Test driven development</h1>
+<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>
+<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>I do Happy Path testing - kind of minimal TDD + SDD.</li>
+<li>Brian does 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>
+<div class="slide" id="py-test-core-concepts">
+<h1>py.test core concepts</h1>
<p><em>The fundamental features of py.test (about 10 minutes)</em></p>
<ul class="simple">
<li>no boilerplate: write tests rapidly</li>
@@ -388,6 +410,18 @@
<li>lots of useful information when a test fails</li>
</ul>
</div>
+<div class="slide" id="how-it-starts">
+<h1>how it starts</h1>
+<p>$ py.test</p>
+<p>(DEMO)</p>
+</div>
+<div class="slide" id="automatic-test-discovery">
+<h1>automatic test discovery</h1>
+<p>search all <cite>test_</cite> and <cite>_test</cite> files</p>
+<p class="handout">py.test searches for all modules which start with <cite>test_</cite> or end with
+<cite>_test</cite>. Within those modules, it collects all functions and methods which
+start with <cite>test_</cite>.</p>
+</div>
<div class="slide" id="function-or-class">
<h1>function or class</h1>
<pre class="literal-block">
@@ -401,22 +435,6 @@
<p class="handout">Use individual test functions or group tests in classes. Use whichever
makes the most sense for each test or group of tests.</p>
</div>
-<div class="slide" id="automatic-test-discovery">
-<h1>automatic test discovery</h1>
-<pre class="literal-block">
-def test_something():
- assert True
-
-class TestSomething():
- def test_something(self):
- assert True
-
-# search all test_* and *_test files
-</pre>
-<p class="handout">py.test searches for all modules which start with <cite>test_</cite> or end with
-<cite>_test</cite>. Within those modules, it collects all functions and methods which
-start with <cite>test_</cite>.</p>
-</div>
<div class="slide" id="assert-introspection">
<h1>assert introspection</h1>
<pre class="literal-block">
@@ -439,7 +457,7 @@
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
@@ -452,12 +470,13 @@
<h1>less boilerplate</h1>
<p>py.test uses naming conventions to reduce boilerplate registration code.</p>
<ul class="simple">
+<li>file, function, class, method</li>
<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>
+<p>All of these features simplify writing your tests.</p>
</div>
<div class="slide" id="and-many-more">
<h1>and many more</h1>
@@ -531,6 +550,7 @@
<li>working with failures - debug with print</li>
<li>bonus: exceptions</li>
</ul>
+<p>todo add slides on asserts and another on raises</p>
</div>
<div class="slide" id="exercise-2-10-min">
<h1>exercise 2 (~10 min)</h1>
@@ -540,7 +560,7 @@
assert True
def test_two():
assert 1 == 1
-@py.test.mark(xfail="Expected failure.")
+@py.test.mark.xfail("Expected failure.")
def test_three():
assert 1 == 2
def test_bonus():
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:54:09 2009
@@ -16,8 +16,8 @@
the plan
========
-- `motivation`_
-- `what you get with py.test`_
+- `motivation and terms`_
+- `py.test core concepts`_
- `installation`_ (w/exercise)
- `basic usage`_ (w/exercise)
- `break`_
@@ -27,18 +27,23 @@
- `wrap up & questions`_
-presenters
-==========
+us
+==
+
+Brian Dorsey <brian at dorseys.org>
+
+enthusiastic user of py.test.
-Brian Dorsey <brian at dorseys.org> - enthusiastic user of py.test.
-Holger Krekel <holger at merlinux.eu> - lead developer of py.test.
+Holger Krekel <holger at merlinux.eu>
+lead developer of py.test.
-You
+
+you
===
-- Who are you?
+Who are you?
.. class:: handout
@@ -47,14 +52,38 @@
python testing libraries: unitest, nose, py.test...
-motivation
-==========
+motivation and terms
+====================
+
+*(about 10 minutes)*
+
+
+A pragmatic view on test types
+=================================
+
+let's talk about small, medium or large tests.
+
-*why automated testing? (about 10 minutes)*
+Small Tests: one aspect
+==============================
-- focusing mostly on unit testing (small tests) in this tutorial
+.. image:: img/small.png
+ :align: center
+
+
+Medium Tests: two aspects
+==============================
+
+.. image:: img/medium.png
+ :align: center
+
+
+Large Tests: three/more
+==============================
+
+.. image:: img/large.png
+ :align: center
-TODO - add small medium large slides
why do automated testing?
=========================
@@ -65,24 +94,23 @@
- leads to faster development and easier maintenance
-Test driven development
+test driven development
=======================
- There is some religion around Test Driven Development.
-Pragmatism
+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
-- I do Happy Path testing - kind of minimal TDD + SDD.
+- Brian does Happy Path testing - kind of minimal TDD + SDD.
-what you get with py.test
-=========================
+py.test core concepts
+=====================
-TODO - title wording
*The fundamental features of py.test (about 10 minutes)*
- no boilerplate: write tests rapidly
@@ -90,8 +118,8 @@
- lots of useful information when a test fails
-how it starts
-=============
+lets go!
+========
$ py.test
@@ -101,7 +129,7 @@
automatic test discovery
========================
-search all test_* and *_test files
+search all `test_` and `_test` files
.. class:: handout
@@ -162,7 +190,6 @@
print "Useful debugging information."
assert False
-TODO: fix all xfail s
.. class:: handout
@@ -176,6 +203,7 @@
py.test uses naming conventions to reduce boilerplate registration code.
+- file, function, class, method
- TestSuite discovery story
@@ -280,7 +308,7 @@
assert True
def test_two():
assert 1 == 1
- @py.test.mark(xfail="Expected failure.")
+ @py.test.mark.xfail("Expected failure.")
def test_three():
assert 1 == 2
def test_bonus():
Modified: py/extradoc/talk/pycon-us-2009/pytest-introduction/test_examples.py
==============================================================================
--- py/extradoc/talk/pycon-us-2009/pytest-introduction/test_examples.py (original)
+++ py/extradoc/talk/pycon-us-2009/pytest-introduction/test_examples.py Thu Mar 26 04:54:09 2009
@@ -7,17 +7,6 @@
class TestSomething():
def test_something(self):
assert True
-# automatic test discovery
-#
-
-def test_something():
- assert True
-
-class TestSomething():
- def test_something(self):
- assert True
-
-# search all test_* and *_test files
# assert introspection
#
@@ -35,7 +24,7 @@
print "Useful debugging information."
assert True
- at py.test.mark(xfail="Expected failure.")
+ at py.test.mark.xfail("Expected failure.")
def test_something2():
print "Useful debugging information."
assert False
@@ -47,7 +36,7 @@
assert True
def test_two():
assert 1 == 1
- at py.test.mark(xfail="Expected failure.")
+ at py.test.mark.xfail("Expected failure.")
def test_three():
assert 1 == 2
def test_bonus():
More information about the pytest-commit
mailing list