librelist archives

« back to archive

Testing

Testing

From:
Alessio Civitillo
Date:
2012-02-17 @ 10:48
Hello,

I am creating a new application in Flask and I would like to program and
test at the same time. However, I do not know much about testing, are there
any references that could help out? I mean, not only the practical side
(which thanks to the Flask tutorial appears quite clear to me), but
especially the theory, the common practices behind testing for a web app.

Thanks,
Alessio

Re: [flask] Testing

From:
Simon Zimmermann
Date:
2012-02-19 @ 09:27
On 17 February 2012 11:48, Alessio Civitillo <alessiocivitillo@gmail.com> wrote:
> I am creating a new application in Flask and I would like to program and
> test at the same time. However, I do not know much about testing, are there
> any references that could help out? I mean, not only the practical side
> (which thanks to the Flask tutorial appears quite clear to me)

Not going to google for you, but just to point out the obvious testing
resources at docs/testing[1]. However, python unittest[2] has enough
features to write all the tests in the world (IMO), so the flask
specific tools are used when you want mock requests, responses, apps
etc. Flask will use Werkzeug's testing utilities[3] to do most of its
heavy lifting so it doesn't hurt to look at that either. nose[4], used
together with coverage[5], make running running tests easier in my
experience.

> especially the theory, the common practices behind testing for a web app.

I would look at some popular ruby projects and try to mimic/understand
what they are doing. In my experience not many python
projects(including my own) get the testing bit right. Avoid doing
integration testing when you want to do unittesting, for example.
Don't know about all the TDD guru's and such, but went to a local
javameetup a couple years ago with Micheal Feathers. He had some good
points and ideas you might want to check out.

[1]: http://flask.pocoo.org/docs/testing/
[2]: http://docs.python.org/library/unittest.html
[3]: http://werkzeug.pocoo.org/docs/test/
[4]: http://readthedocs.org/docs/nose/en/latest/
[5]: http://pypi.python.org/pypi/coverage

Re: [flask] Testing

From:
dorian i
Date:
2012-02-19 @ 09:33
Are you talking about unittest?  http://flask.pocoo.org/docs/testing/

On Fri, Feb 17, 2012 at 11:48 AM, Alessio Civitillo <
alessiocivitillo@gmail.com> wrote:

> Hello,
>
> I am creating a new application in Flask and I would like to program and
> test at the same time. However, I do not know much about testing, are there
> any references that could help out? I mean, not only the practical side
> (which thanks to the Flask tutorial appears quite clear to me), but
> especially the theory, the common practices behind testing for a web app.
>
> Thanks,
> Alessio
>