Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
自定义 pytest junitxml 失败报告
我正在尝试内省测试失败并将附加数据包含到 junit xml 测试报告中 具体来说 这是对外部产品的一套功能测试 我想将产品的日志包含到故障报告中 使用找到的方法here https stackoverflow com questions
python
logging
Pytest
参数化测试也取决于 pytest 中的参数化值
我有一个测试 我有一个设置方法 应该收到一个dataset和一个测试函数 应该为每个运行data in dataset 基本上我需要类似的东西 datasetA data1 a data2 a data3 a datasetB data1
unittesting
Pytest
fixtures
在测试中检查 CLI 的退出代码
我正在为命令行工具编写自动化测试 本质上 我想使用各种选项调用 CLI 并测试退出代码和 或输出 我的测试如下所示 from mymodule cli tool import main def test args capfd with py
python
Pytest
exitcode
在 pytest 中参数化并运行单个测试
如何从配置了参数化的集合中运行单个测试 假设我有以下测试方法 pytest mark parametrize PARAMETERS LIST PARAMETERS VALUES def test my feature self param1
python
python27
Testing
automatedtests
Pytest
pytest 由于 ModuleNotFoundError 失败,但在使用“python -m pytest”时有效
类似于这个OP的问题 https stackoverflow com questions 56755761 filenotfounderror when using python m pytest vs pytest 但反过来说 pytes
python3x
unittesting
Testing
VisualStudioCode
Pytest
Pytest - 测试解析器错误:无法识别的参数
我正在尝试测试一个非常简单的函数 由于多次尝试测试使用参数解析器作为参数的更复杂的函数而失败 来自 runfile py import argparse import os def get input args parser argpars
python
Testing
Pytest
py.test 无法导入我的模块
我正在努力正确导入 python 我想要实现的是拥有一个包含多个源文件的模块和一个包含单元测试的测试文件夹 无论我做什么 我都无法让 py test 3 执行我的测试 我的目录布局如下所示 module init py testclass
python
unittesting
python3x
Pytest
Pytest 适用于旧的模拟,但不适用于 unittest.mock
我正在将一些代码从 Python 2 移植到 3 并且py test玩得不好patch装饰器来自unittest mock 当我使用patch装饰器将模拟传递到测试函数的参数中 py test相反 将该参数解释为固定装置 并且无法设置测试
python
unittesting
python3x
mocking
Pytest
使用conftest.py 与从专用模块导入装置
我最近开始熟悉 pytest 以及如何使用conftest py定义在我的测试中自动发现和导入的装置 我很清楚如何conftest py工作原理以及如何使用它 但我不确定为什么这在某些基本场景中被认为是最佳实践 假设我的测试是这样构建的 t
python
Pytest
尝试使用 pytest 在 python 3.10 上执行测试时出错
如果我尝试使用执行测试pytest使用 python 3 10 我收到以下错误 TypeError required field lineno missing from alias 谷歌说这是一个已知问题 但我找不到解决的方法 如果我用 3
python
Pytest
python310
如何在pytest运行时获取测试名称和测试结果
我想在运行时获取测试名称和测试结果 I have setup and tearDown我的脚本中的方法 在setup 我需要获取测试名称 然后在tearDown我需要获取测试结果和测试执行时间 我有办法做到这一点吗 你可以 使用钩子 我的测
Pytest
使用 pytest 生成 csv 文件报告
是否可以以某种方式在 csv 文件中生成测试执行报告 我使用 python selenium pytest 任何建议将不胜感激 我写了一个pytest csv https github com nicoulaj pytest csv插件 希
python
selenium
Pytest
pytest 固定装置 - 获取值并避免错误“直接调用固定装置'X'”
我已将 pytest 更新到 4 3 0 现在我需要重新编写测试代码 因为不推荐直接调用固定装置 我对 unittest TestCase 中使用的固定装置有疑问 如何获取从固定装置返回的值而不是对函数本身的引用 例子 pytest fix
python
Pytest
fixtures
如何使用 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 夹具
我想为我的测试函数构建一个有多种用途的装饰器 其中之一是帮助将属性添加到生成的junitxml 我知道有一个fixture https docs pytest org en latest usage html record property
python27
Pytest
如何在 pytest 中仅运行未标记的测试
我的 python 测试代码中有几个标记 pytest mark slowtest pytest mark webtest pytest mark stagingtest 我可以使用标记有选择地运行测试 例如pytest m slowtes
python
Pytest
Selenium 登录测试不接受 pytest 设备登录或拒绝连接
我变得绝望 因为我似乎找不到一个我认为每个人都会使用的解决方案 我想使用 selenium 和 pytest 以及 live server url 来测试简单的登录 根据 pytest django 文档 一个简单的固定装置称为live s
python
Docker
selenium
Pytest
pytest 无法导入模块,而 python 可以
我正在用 Python 开发一个包 我使用虚拟环境 我在 virtualenv 的 pth 路径中设置了模块根目录的路径 这样我就可以在开发代码时导入包的模块并进行测试 问题 1 这是一个好方法吗 这工作正常 这是一个例子 这是我想要的行为
python
import
Pytest
测试设置时的 PytestDeprecationWarning:funcargnames 属性是 Fixturenames 的别名
以下教程为https testdriven io https testdriven io 我创建了一个 websocket 测试来测试我的 websocket 连接 tests test websockets py from django
python
django
Pytest
djangochannels
pytest - 在 setup_module 中使用 funcargs
我在 conftetst py 中包含了我自己的命令行选项 def pytest addoption parser parser addoption backend default test backend help run testx f
Pytest
1
2
3
4
5
6
...20
»