腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
1
回答
pytest
no django "lazy_django.py no Django settings“
、
、
django_project/ - django_app/ - manage.py 现在,当我在main_project路径上运行
pytest
/projects/django_project时,它可以通过django_project
pytest
。但是我想运行一个
pytest
来运行整个
pytest
,包括main_project路径上的project1和django_project,它通
浏览 2
提问于2020-11-13
得票数 1
1
回答
Pytest
找不到
文件
/
模块
、
、
我的测试
文件
夹中没有init.py,我尝试使用conftest。--non-default-config.json --test1.py CFG = json.load(f)但是,当我运行
pytest<
浏览 98
提问于2020-10-27
得票数 0
回答已采纳
4
回答
如何运行
pytest
-bdd测试?
、
我不明白如何用库
pytest
-bdd正确地运行一个简单的测试(功能
文件
和python
文件
)。 从官方的来看,我不明白应该发出什么命令来运行测试。我尝试使用
pytest
命令,但我看到运行了NO test。我是否需要使用另一个库behave来运行功能
文件
?
浏览 8
提问于2019-02-19
得票数 3
1
回答
如何禁用单个测试的
pytest
插件
、
、
、
我安装了新的
pytest
插件(
pytest
-catchlog==1.2.2),它破坏了日志
模块
(例如,ValueError: I/O operation on closed file)的单元测试。我想禁用test_logging.py
文件
的插件(甚至是类或方法),但是我
找不到
它的任何信息。到目前为止,我发现的唯一选项是执行两次
pytest
:第一次只对禁用了test_logging.py的py.test -p no:catchlog test_logging.py执行,第二次只
浏览 2
提问于2016-06-20
得票数 15
回答已采纳
1
回答
无法从requirements.txt安装
pytest
、
、
、
、
我正在使用pip3为我的python项目安装
模块
。我的requirements.txt看起来是这样的:cx_freeze==6.0b1
pytest
-cov==2.5.1显然,我的需求中添加了
pytest
,但是当我运行pip3 install -r requirements.txt时,它
找不到
pytest
,并显示了以下异常: Complete output/
浏览 3
提问于2018-03-13
得票数 2
回答已采纳
2
回答
ModuleNotFoundError: IntelliJ IDEA中没有名为“
pytest
”的
模块
、
、
、
/xxxx/xxxx/Library/Application Support/JetBrains/IdeaIC2021.1/plugins/python-ce/helpers/pycharm/_jb_
pytest
_runner.py", line 2, in <module>ModuleNotFoundError: No module named '
pytest
&
浏览 13
提问于2021-11-18
得票数 0
回答已采纳
2
回答
pytest
找不到
模块
、
、
我在跟踪,或者至少我认为我是但是,
pytest
找不到
我的
模块
。它似乎没有将当前目录包括在其PYTHONPATH中。源
文件
: return x + yimport
pytest
4.0K ook.py 0 __init__.pytotal 4.0K 4.0K test_ook.py 0 __pyc
浏览 0
提问于2018-02-28
得票数 50
回答已采纳
1
回答
找不到
pytest
模块
、
、
在我的包上运行
pytest
时遇到了问题。我有以下结构... tree -f├── [ 0 Jan 4 22:04] ./tmp/test.py 我的conftest.py有下面的. """"""import
pytest
def tcx_file(): Fixture of TCX file &quo
浏览 29
提问于2020-01-12
得票数 0
1
回答
使用Makefile和make命令进行
pytest
、
src│ ├── cli.py└── testssetup.py
文件
linuxacademy.com', package_dir={'': 'src'},Makefile
文件
/src
pytest
tests/
浏览 1
提问于2018-09-15
得票数 4
回答已采纳
4
回答
'py.test‘未被识别为内部或外部命令、可操作程序或批处理
文件
、
、
我从我的Windows cmd发出以下命令来安装
pytest
框架及其所需的依赖项然后发布:py -3 -m pip install
pytest
-pep8但是当我想要通过py.test --pep8 exp1.py命令运行
pytest
时,我得到了提到的错误。 有什么想法吗?
浏览 4
提问于2020-09-14
得票数 2
1
回答
pytest
如何抛出F6401 Can-枚举-
pytest
-夹具
、
、
我添加了一个新的包executor,包括三个
模块
,一个是base.py的抽象
模块
,两个对应于不同的实现
模块
(local.py、docker.py)。然后我运行isort,pylint运行得很好再次,我想强调,在我添加这个
模块
之前,一切都很好。但是现在我刚刚添加了这个
模块
的源代码,这个异常就会出现。让
浏览 0
提问于2021-06-24
得票数 2
4
回答
ModuleNotFoundError:没有名为“
pytest
”的
模块
、
在虚拟环境中安装
pytest
模块
之后,我使用python代码调用并运行提示来查找
pytest
模块
。 assert 5!=5
pytest
.main() 运行python -u "d:\MyPytest\test_sa
浏览 5
提问于2019-04-12
得票数 30
1
回答
如何导入从json
文件
读取数据的py
模块
?
、
、
、
我对
pytest
测试和尝试测试python
模块
main.py是个新手,它包含类和函数,并且还读取静态config.json
文件
。当我为我的
pytest
导入main
模块
并运行我的测试时,我得到一个错误,即
找不到
json
文件
。我希望再次运行一个简单的测试,测试我在main.py中定义的不需要config.json数据的类。我已经尝试将
pytest
放在项目目录的不同部分,但没有任何帮助。我还尝试从我的程序创建一个包,在MANIFEST.in
文件</e
浏览 18
提问于2019-05-02
得票数 0
2
回答
当在父项目上运行
pytest
时,如何忽略git子
模块
根目录下的conftest.py
文件
(例如子
模块
/conftest.py)?
、
、
、
、
问题我的项目中有许多git子
模块
,它们包含自己的测试配置。==================================
浏览 7
提问于2021-03-26
得票数 1
2
回答
获取剩余测试用例计数的Py.Test
、
是否有一种方法可以获得尚未用Py.Test执行的测试用例(在具有功能范围的py.test安装夹具中或在
pytest
_exception_interact中)。当测试用例失败时,我在混淆测试中设置一个全局标志,以指示测试失败,并在
pytest
_exception_interact中将应用程序重置为默认状态,在下一个函数的函数设置中,在执行测试之前验证此标志以运行一组预条件
浏览 1
提问于2015-06-22
得票数 3
回答已采纳
1
回答
pytest
无法定位动态创建的
模块
。
、
、
我有一个目录结构,如下所示:在foo.py中,我有一个函数,它创建一个包含函数(f)的
文件
(bar.py)。然而,在运行
pytest
时,情况并非如此。我们从package_root运行
pytest
,当它试图导入它时,它
找不到
模块
条。这是因为(我相信)在运行
pytest
时,它在/package_root中创建/package_root,其中不包含init.py<em
浏览 0
提问于2019-08-12
得票数 0
1
回答
需要预先加载
模块
时,在VS代码中运行
pytest
、
、
我试图在VS代码中使用
pytest
,运行在red中。我所使用的环境意味着在运行之前我需要加载诸如
pytest
这样的
模块
。在终点站,我可以运行:
pytest
如何在运行
pytest
之前告诉测试环境运行我的module l
浏览 3
提问于2020-02-24
得票数 1
回答已采纳
1
回答
如何让
pytest
重写非测试
模块
中的断言
、
我们在单独的python
文件
中定义了所有自定义断言,该
文件
不是测试
模块
。AssertionError: some error messageE - foo但是我们发现,如果调用我们在单独
模块
中定义的断言方法: > assert 'foo' == 'bar', 'some error message'
浏览 5
提问于2016-06-30
得票数 15
2
回答
如何在
pytest
中设置每个测试超时的默认值?
、
我想要强制规定,在
pytest
中,任何测试都不需要超过3秒。 几乎可以做我想做的事.但是它似乎允许我设置全局超时(即确保测试套件不超过10分钟),或者手动设置每个测试的修饰器。想要的行为:用一个设置配置
pytest
,使任何超过3秒的单个测试都失败。
浏览 2
提问于2017-04-24
得票数 16
1
回答
用
pytest
标记编写python脚本的Sphinx文档
、
、
、
我一直在研究如何使用Sphinx来记录使用
pytest
的测试
模块
。在脚本中有用户定义的
pytest
.mark。是否有一种方法可以将Sphinx或.rst模板
文件
配置为包含
pytest
.mark定义,即使它们在docstring之外?关于使用:regexp:的斯芬克斯文档非常模糊,我一直
找不到
一个使用它的好例子。pytestmark = [
pytest
.ma
浏览 1
提问于2016-01-09
得票数 2
回答已采纳
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
每日一模块:pytest
pytest-yaml-sanmu(一):把yaml作为测试文件的pytest插件
找不到文件?正确的文件找回方法分享!
python 找不到 numpy 模块的原因是什么
电脑文件找不到被误删,如何恢复?
热门
标签
更多标签
云服务器
ICP备案
腾讯会议
云直播
对象存储
活动推荐
运营活动
广告
关闭
领券