Main Content
Flask and unittest - hello web app test world Archive - Originally posted on "The Horse's Mouth" - 2015-10-15 07:26:32 - Graham Ellis
Flask comes with a test client that you can use within unittest - I've put together a really short test of "hello world" [here] . The test example is ugly with the Flask application within the test harness, and should be improved by the importing of the appication to be tested.
Some other articles
Y307 - The Flask micro webdevelopment framework for Python Unittest of a Flask application including forms This article Flask - complete MVC site to navigate around a data set Sessions in flask Flask - first forms and responses with wtforms Jinja2 - Flask templating Requests in Flask Flask - calling in the templating engine Routing in Flask Hello Flask world / Python web micro framework Y212 - Code testing, patterns, profiles and optimisation. Profiling your Python program Pytest - second example beyond hello world Pytest - starting example The principle of mocking - and the Python Mock package Unittest of a Flask application including forms This article Testing in Python 3 - unittest, doctest and __name__ == __main__ too. Combining tests into suites, and suites into bigger suites - Python and unittest Python base and inherited classes, test harness and unit testing - new examples Learning to program - comments, documentation and test code Test Driven Development in Python - Customer Comes First Using Make for a distribution Testing your Python classes with the unittest package - how to Passing optional and named parameters to python methods A demonstration of how many Python facilities work together Pressing ^C in a Python program. Also Progress Bar. Defining a static method - Java, Python and Ruby Using Python with OpenOffice Advanced Python, Perl, PHP and Tcl training courses / classes Python decorators - wrapping a method call in extra code __new__ v __init__ - python constructor alternatives? Python GTK - Widget, Packing, Event and Feedback example Preparation for a day's work