django - 如何从覆盖范围中排除文件?

标签 django python-3.x unit-testing django-rest-framework django-views

我正在运行我的单元测试。但我想在测试期间排除一些文件夹和文件。
这是我的 .coveragerc 文件

[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/
我需要排除这些文件,但它不起作用。

最佳答案

终于得到了解决方案:

[run]
 omit =
 */environment/*
 */migrations/*
  Amazon_customers/*
  manage.py

关于django - 如何从覆盖范围中排除文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51036869/

相关文章:

python - 字段级权限 Django

map 上的 Python 多处理

macos - 错误 : command 'gcc' failed with exit status 1 while installing pygresql

python - 将任意函数与 MyPy 的 TypeVar 绑定(bind)属性一起使用

仅具有私有(private)功能的 AngularJS 单元测试 Controller

python - Django项目中的导入错误: No module named simple while running manage. py测试

django - 在生产环境中通过 Django 发送 SMTP 电子邮件

python - 在 Django DetailView 中获取表单

javascript - 无法使用 Backbone.history.start() 和 QUnit 调用未定义错误的方法 'start'

java.lang.NoSuchMethodError : No interface method onTransitionToIdle()V 错误