Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
如何将 pytest 装置与 django TestCase 一起使用
我如何在TestCase方法 类似问题的几个答案似乎暗示我的例子应该有效 import pytest from django test import TestCase from myapp models import Category py
python
django
Pytest
djangotests
pytestdjango
我无法在 PyCharm 下运行 Django Python pytest
pytest portal test session starts platform darwin Python 3 6 0 pytest 3 0 6 py 1 4 32 pluggy 0 4 0 Django settings confi
python
django
pycharm
Pytest
pytestdjango
如何使用 django-pytest 跟踪 Django 重定向?
在设置一个档案索引视图 https docs djangoproject com en 2 0 ref class based views generic date based django views generic dates Arch
django
Pytest
pytestdjango
使用 pytest-django 进行测试期间,Django 连接对象看不到第二个数据库的表
底线 在使用 pytest django 进行测试期间 我的 Django 连接对象看不到第二个数据库的表关系 概述 我有一个问题 我的 Django 连接对象似乎获取了错误的数据库信息 当我查询 客户 数据库中的表时 我偶然发现了这个问题
django
Pytest
pytestdjango
pytest django:无法访问固定装置拆卸中的数据库
我需要在使用夹具后显式删除它 我知道 pytest django 默认情况下会在拆卸时删除所有对象 但在这种特殊情况下 我需要手动执行此操作 然而 虽然我的测试被标记为pytest mark django db 我能够创建一个夹具 但在经过
django
Pytest
pytestdjango
即使有标记,pytest-django 也不允许数据库访问
我很难找出我的设置出了什么问题 我正在尝试测试登录视图 无论我尝试什么 我都会得到 Database access not allowed use the django db mark or the db or transactional
django
Pytest
pytestdjango
如何使用 xdist 和 django_coverage_plugin 并行 pytest 运行覆盖率报告
使用以下设置 计算出的覆盖率小于使用没有并行化的单线程的覆盖率 Coverage 仅在项目根目录中创建 1 个覆盖文件 我预计这就是问题所在 我无法确定我做错了什么 报告的覆盖范围比我简单地运行要少coverage m pytest 在单线
python
Pytest
codecoverage
coveragepy
pytestdjango
剧作家 + Django:如何等待事件
在我的测试中 我必须等待事件触发才能继续测试断言 但我不知道如何让 Playwright 等待该事件 剧作家似乎看不到该事件 django 页面的简单示例 单击按钮会触发事件boop改变文档的背景颜色 模板event html
django
pytestdjango
playwrightpython
禁用特定 pytest 标记上的自动使用装置
是否可以阻止执行 功能范围 的装置autouse True仅在特定标记上 我将以下固定装置设置为自动使用 以便自动模拟所有传出请求 pytest fixture autouse True def no requests monkeypatc
python
Pytest
pytestdjango
VS Code 找不到 pytest 测试
我在 vs code 中设置了 PyTest 但即使从命令行运行 pytest 工作正常 也没有找到任何测试 我正在使用 MiniConda 和 Python 3 6 6 虚拟环境在 Win10 上开发 Django 应用程序 VS Cod
python
python3x
VisualStudioCode
Pytest
pytestdjango
如何在 py.test 中显示警告
我刚刚跑了py test http pytest org在我的代码上并得到以下输出 6 passed 2 pytest warnings in 40 79 seconds 但是 我看不到什么py test想警告我一下 如何打开控制台的警告输
python
django
Testing
Pytest
pytestdjango
Django 测试表没有被创建
我正在尝试为我的 django 项目编写测试用例 但是当我运行时 manage py 测试 命令 它正在创建测试数据库 但没有创建任何表 并且我收到一个错误 表明表不存在 欢迎任何建议 这是我通过 manage pyspectdb gt m
python
django
djangotesting
pythonunittest
pytestdjango