[TIP] Declarative style acceptance tests

Tres Seaver tseaver at palladion.com
Mon Jan 6 13:28:41 PST 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/06/2014 03:53 PM, Paul Moore wrote:
> Can you clarify why? It may be that the reason is that what you're 
> referring to as acceptance tests is not what I'm trying to create
> (see below).

"Straight" doctests don't model user stories very well, except (some
argue) if your users are other software developers (i.e., you are writing
a library).  They also have significant maintainability defects (e.g.,
subtle changes in "irrelevant" details like object reprs and traceback
formatting between Python versions).  Working around those defects tends
to reduce their value as documentation.

Benji York's 'manuel'[1][2] allows extending doctests with custom
syntax[3], such that the tescases can be expressed in more "user
comprehensible" form than exercising the API at the Python prompt.


[1] https://pypi.python.org/pypi/manuel

[2] http://pythonhosted.org/manuel/

[3] http://pythonhosted.org/manuel/table-example.html


Tres.
- -- 
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlLLIAkACgkQ+gerLs4ltQ703wCaAx5H/HMw7zlrmGT7/gZ7kg88
DdYAoIgFFZLxJ4/6Sr5/tc6ug1DB5liX
=kPiv
-----END PGP SIGNATURE-----




More information about the testing-in-python mailing list