O'Reilly logo

Learning Flask Framework by Charles Leifer, Matt Copperwaite

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Flask and unit testing

You may be thinking: "Unit tests look great for small sections of code, but how do you test it for an entire Flask app?" Well one of the ways, as mentioned previously, is to make sure that all your methods are as discrete as possible—that is, to make sure your methods do the least possible work to complete their function, and to avoid repetition between methods. If your methods are not discrete, now is a good time to get them tidied up.

Another thing that will help is that Flask comes readymade for unit testing. There is a good chance that any existing application can have at least some unit tests applied to it. Especially, any areas of API such as in unable to verify will be extremely easy to test by making use of the methods ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required