Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Exclude files from coverage?

Tags:

I am running my unit tests. But I want to exclude some folders and files during tests.

Here is my .coveragerc file

[run]
 branch = True
 source = .
 omit =
  Amazon_customers/.coveragerc
  amazon_customers/tests
  Amazon_customers/__init__.py
  Amazon_customers/urls.py
  Amazon_customers/wsgi.py
  amazon_customers/test_utils/*
  /migrations/
  /manage.py/

I need to exclude these files but it is not working.

like image 592
Muhammad Zaman Avatar asked Jun 26 '18 07:06

Muhammad Zaman


1 Answers

Finally got the solution:

[run]
 omit =
 */environment/*
 */migrations/*
  Amazon_customers/*
  manage.py
like image 185
Muhammad Zaman Avatar answered Sep 28 '22 17:09

Muhammad Zaman