Cookiecutter-django: run coverage with docker

Created on 19 Jul 2017  路  7Comments  路  Source: pydanny/cookiecutter-django

Hello!

I just recently started using cookiecutter and I do not understand how to run coverage?
I created the application, and run the tests like this: docker-compose -f dev.yml run django py.test

But how do I start the coverage ?

Thanks!

Most helpful comment

@narnikgamarnikus try

docker-compose -f local.yml run --rm django coverage run --source . -m py.test
docker-compose -f local.yml run --rm django coverage report
docker-compose -f local.yml run --rm django coverage html

All 7 comments

@narnikgamarnikus try

docker-compose -f local.yml run --rm django coverage run --source . -m py.test
docker-compose -f local.yml run --rm django coverage report
docker-compose -f local.yml run --rm django coverage html

@webyneter , how i can run open htmlcov/index.html, and how i can add coverage badge to my README.rst ?
I am sure that here it should be provided.

@narnikgamarnikus type it directly on to the terminal so long as you are in the project folder.
open htmlcov/index.html

@narnikgamarnikus,

how i can add coverage badge to my README.rst?

Take a look at my recent project, https://github.com/webyneter/python-humble-utils I've integrated with codecov.

@narnikgamarnikus, to integrate with codecov,

  1. you should first sign up;
  2. then, follow the instructions they provide;
  3. finally, find the badge at one of the codecov's pages related to your account: As far as I remember, they do provide the one for inclusion into *.rst files.

@narnikgamarnikus can I close this one?

@webyneter , yes.
Thanks you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sebastian-code picture sebastian-code  路  4Comments

linuxluigi picture linuxluigi  路  3Comments

StupidTAO picture StupidTAO  路  3Comments

jayfk picture jayfk  路  4Comments

webyneter picture webyneter  路  4Comments