Skip to Content
Flask Framework Cookbook - Second Edition
book

Flask Framework Cookbook - Second Edition

by Shalabh Aggarwal
July 2019
Beginner to intermediate
302 pages
9h 38m
English
Packt Publishing
Content preview from Flask Framework Cookbook - Second Edition

How to do it...

The simplest way of getting the coverage is to use the command line:

  1. Simply run the following command:
$ coverage run --source=../<Folder name of application> --omit=app_tests.py,run.py app_tests.py 

Here, --source indicates the directories that are to be considered in coverage, and --omit indicates the files that need to be omitted in the process.

  1. Now, to print the report on the terminal itself, run the following command:
    $ coverage report 

The following screenshot shows the output:

  1. To get a nice HTML output of the coverage report, run the following command:
    $ coverage html 

This will create a new folder named htmlcov ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Writing a Web Application with Flask

Writing a Web Application with Flask

Doug Farrell
Mastering Flask

Mastering Flask

Jack Stouffer

Publisher Resources

ISBN: 9781789951295Supplemental Content