- add a Package/dir level setup example

- make tox.ini's doc/regen use pytest release instead of dev version
This commit is contained in:
holger krekel
2012-11-07 11:11:40 +01:00
parent 476d210d09
commit ff0c75aa34
15 changed files with 182 additions and 84 deletions

View File

@@ -79,7 +79,7 @@ marked ``smtp`` fixture function. Running the test looks like this::
================================= FAILURES =================================
________________________________ test_ehlo _________________________________
smtp = <smtplib.SMTP instance at 0x1992a70>
smtp = <smtplib.SMTP instance at 0x2934a28>
def test_ehlo(smtp):
response, msg = smtp.ehlo()
@@ -89,7 +89,7 @@ marked ``smtp`` fixture function. Running the test looks like this::
E assert 0
test_smtpsimple.py:12: AssertionError
========================= 1 failed in 0.30 seconds =========================
========================= 1 failed in 0.26 seconds =========================
In the failure traceback we see that the test function was called with a
``smtp`` argument, the ``smtplib.SMTP()`` instance created by the fixture
@@ -197,7 +197,7 @@ inspect what is going on and can now run the tests::
================================= FAILURES =================================
________________________________ test_ehlo _________________________________
smtp = <smtplib.SMTP instance at 0x2b8a248>
smtp = <smtplib.SMTP instance at 0x13b9cf8>
def test_ehlo(smtp):
response = smtp.ehlo()
@@ -209,7 +209,7 @@ inspect what is going on and can now run the tests::
test_module.py:6: AssertionError
________________________________ test_noop _________________________________
smtp = <smtplib.SMTP instance at 0x2b8a248>
smtp = <smtplib.SMTP instance at 0x13b9cf8>
def test_noop(smtp):
response = smtp.noop()
@@ -218,7 +218,7 @@ inspect what is going on and can now run the tests::
E assert 0
test_module.py:11: AssertionError
========================= 2 failed in 0.48 seconds =========================
========================= 2 failed in 0.22 seconds =========================
You see the two ``assert 0`` failing and more importantly you can also see
that the same (module-scoped) ``smtp`` object was passed into the two
@@ -271,7 +271,7 @@ using it has executed::
$ py.test -s -q --tb=no
FF
finalizing <smtplib.SMTP instance at 0x1584908>
finalizing <smtplib.SMTP instance at 0x28a4830>
We see that the ``smtp`` instance is finalized after the two
tests using it tests executed. If we had specified ``scope='function'``
@@ -342,7 +342,7 @@ So let's just do another run::
================================= FAILURES =================================
__________________________ test_ehlo[merlinux.eu] __________________________
smtp = <smtplib.SMTP instance at 0x2368248>
smtp = <smtplib.SMTP instance at 0x26c7200>
def test_ehlo(smtp):
response = smtp.ehlo()
@@ -354,7 +354,7 @@ So let's just do another run::
test_module.py:6: AssertionError
__________________________ test_noop[merlinux.eu] __________________________
smtp = <smtplib.SMTP instance at 0x2368248>
smtp = <smtplib.SMTP instance at 0x26c7200>
def test_noop(smtp):
response = smtp.noop()
@@ -365,7 +365,7 @@ So let's just do another run::
test_module.py:11: AssertionError
________________________ test_ehlo[mail.python.org] ________________________
smtp = <smtplib.SMTP instance at 0x2377680>
smtp = <smtplib.SMTP instance at 0x26d6638>
def test_ehlo(smtp):
response = smtp.ehlo()
@@ -376,7 +376,7 @@ So let's just do another run::
test_module.py:5: AssertionError
________________________ test_noop[mail.python.org] ________________________
smtp = <smtplib.SMTP instance at 0x2377680>
smtp = <smtplib.SMTP instance at 0x26d6638>
def test_noop(smtp):
response = smtp.noop()
@@ -430,7 +430,7 @@ Here we declare an ``app`` fixture which receives the previously defined
test_appsetup.py:12: test_smtp_exists[merlinux.eu] PASSED
test_appsetup.py:12: test_smtp_exists[mail.python.org] PASSED
========================= 2 passed in 6.79 seconds =========================
========================= 2 passed in 6.43 seconds =========================
Due to the parametrization of ``smtp`` the test will run twice with two
different ``App`` instances and respective smtp servers. There is no