腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(1507)
视频
沙龙
1
回答
pytest
:
获取
AttributeError
:'
CaptureFixture
‘
对象
没有
属性
'
readouterror
’
捕获
标准
输出
python
、
python-3.x
、
pytest
、
stdio
我遵循如何将
标准
输出
捕获
到一个
对象
中,但得到了以下错误: print("hello") > capture = capsys.
readouterror
()E
AttributeE
浏览 9
提问于2019-08-17
得票数 2
回答已采纳
4
回答
检查
输出
并得到报告?
python
、
pytest
Python3.4.1,
pytest
2.6.2。___________________________ test_result_and_stdout ____________________________
AttributeError
: '
Capt
浏览 11
提问于2014-10-25
得票数 23
回答已采纳
2
回答
pytest
不能导入模块并给出SyntaxError
python
、
syntax-error
、
pytest
、
importerror
我使用
pytest
在如下目录中测试我的函数: ├── Sam_Functions ├── AD.pyTest_Functions ├── test_AD.pyAD.py和Pr.py工作得很好,
没有
任何问题然而,在
pytest
中,我面临以下错误:
AttributeError
:‘模块’
对象
没有
浏览 3
提问于2022-08-30
得票数 0
回答已采纳
1
回答
在
PyTest
中如何配置CaptureManager插件错误'CaptureManager‘
对象
没有
属性
’悬置
捕获
‘
python
、
python-3.x
、
pytest
下面的函数是从
pytest
调用的。msg) capture_manager =
pytest
.config.pluginmanager.getplugincapture_manager.resumecapture() return answer 但是,我得到了以下错误:错误: <e
浏览 2
提问于2018-06-01
得票数 1
回答已采纳
2
回答
我想在
pytest
中使用stdin。
python
、
pytest
PyTest
文档指出,
标准
输入被重定向为null,因为
没有
人希望在批处理测试上下文中进行交互式测试。这是真的,但交互式并不是stdin的唯一用途。我很高兴能够
捕获
标准
输出
和字符串,但是如何以符合
PyTest
的方式将
标准
输入连接到io.StringIO
对象
呢?
浏览 0
提问于2016-08-02
得票数 24
3
回答
将(产率)固定装置作为测试参数传递(使用临时目录)
python
、
pytest
问题上下文================================== FAILURES ==========================('thing', [thing1, thing2])&g
浏览 3
提问于2017-07-20
得票数 5
回答已采纳
1
回答
在python日志模块中添加
pytest
测试的自定义日志级别
python
、
logging
、
pytest
我使用的是
pytest
,我希望记录一些日志
输出
,如果测试失败,这些
输出
将被
捕获
和显示。使用的答案,我得到了以下解决方案,但它不起作用。我所看到的错误似乎是在对问题的公认答案的评论中注意到的,但
没有
得到任何答复。
AttributeError<
浏览 6
提问于2022-06-06
得票数 0
回答已采纳
6
回答
pytest
中的日志记录
python
、
logging
、
pytest
我有以下代码片段:import logging mylogger = logging.getLoggerInside Test 2') mylogger.info(' About to start the tests ')
pytest
.main(args=[os.path.abspath(__file
浏览 0
提问于2011-01-13
得票数 144
回答已采纳
2
回答
在单个测试中禁用
pytest
警告
捕获
python
、
pytest
我通常喜欢
pytest
警告
捕获
钩子,因为我可以使用它来强制我的测试套件不触发任何警告。但是,我有一个测试,要求将警告打印到stderr才能正常工作。 如何才能只为一次测试禁用警告
捕获
?
浏览 0
提问于2019-06-04
得票数 1
1
回答
获取
AttributeError
:使用
Pytest
的'NoneType‘
对象
没有
属性
'get’
python-3.x
、
selenium
、
selenium-webdriver
、
pytest
、
attributeerror
当我试图通过终端窗口为不同的浏览器运行我的自动化python脚本时,使用以下命令:其中test_login的python主文件
获取
属性
错误。self.lp.clickLogin() self.driver.close() @
pytest
.fixture
浏览 12
提问于2022-07-21
得票数 -1
8
回答
如何在
pytest
中打印到控制台?
python
、
unit-testing
、
python-2.7
、
pytest
我正在尝试将测试驱动开发( TDD )用于
pytest
。当我使用print时,
pytest
无法通过print连接到控制台。有人知道如何显示打印语句吗?
浏览 318
提问于2014-07-08
得票数 337
回答已采纳
1
回答
如何在同一个类中从一个方法访问另一个方法
python
、
python-3.x
我有下面的代码,但是它给出了一个错误:
AttributeError
:'test_id‘
对象
没有
属性
'IDlist',我想在test02方法中
获取
随机值表单列表: def(self.query) self.IDlist = self.myid.values.tolist() @
pytest
.mark.depende
浏览 2
提问于2018-03-26
得票数 0
回答已采纳
1
回答
record_xml_property不适用于xdist
python
、
pytest
、
xdist
我
没有
直接将
属性
添加到报告器中,而是将它们放到了从
输出
中:def record_xml_property(request):@
pytest
.hookimpl(tryfirst=True) if report.whenfor key, value in node
浏览 3
提问于2017-02-23
得票数 0
2
回答
Python使用字符串值作为类/部分代码
python
、
python-2.7
是否可以在代码中直接使用字符串的值作为类等?我不知道确切地描述我想要对单词做什么,所以伪代码版本可能是理解问题的最好方法。示例如下: nodeinfo = itemdict.get(node) #Example if nodeinfo[1] == "Dot" #link = nuke.nodes.Dot(h
浏览 35
提问于2018-07-01
得票数 0
回答已采纳
1
回答
如何以UTF-8的形式打开HTML文件进行解析?
python-3.x
、
beautifulsoup
、
html-parsing
我试图用python 3使用BeautifulSoup来解析html文件,但是我得到了UTF-8解码错误。我尝试添加选项打开文件解码作为UTF-8,但错误仍然出现。这就是我到目前为止所拥有的。 unicode_html = fp.read().decode('utf-8', 'ignore') soup = BeautifulSoup( unico
浏览 3
提问于2020-02-26
得票数 0
回答已采纳
2
回答
如何用
pytest
测试kfp组件
python
、
pytest
、
kubeflow
、
kubeflow-pipelines
、
kfp
我试图使用
pytest
在本地测试kfp.v2.ds1 (它在管道上工作)中的kubeflow组件,但是与输入/
输出
参数以及固定设备一起挣扎。/fixtures/ @component() def sample_df(dataset: Output[Dataset]):应该作为
输出
传递的OutputDataset不是,因此组件无法正确地使用它,那么我将在assert df['age'].tolist() == expe
浏览 12
提问于2022-10-04
得票数 1
回答已采纳
1
回答
分体式Dataframe列
python
、
pandas
我用金融工具来
获取
期权链信息。在yfinance文档中,它说当检索到的数据将是熊猫的数据。import yfinance as yf data = tk.option_chain('2021-03-26')
输出
如下 然后我试着用这个来分割文本data['ExpirationDate'] = data['contractSumbol'].str.slice(start=4, stop=10)
浏览 1
提问于2021-03-19
得票数 0
回答已采纳
1
回答
如何构造_
pytest
.pytester.Testdir实例
python
、
ipython
、
pytest
我正在尝试进行一些调试(特别是在
pytest
/test/test_doctest.py上),我想在IPython中逐步完成一些代码。我有过
pytest
的经验,但我从来
没有
对它做过任何花哨的事情,所以我从来
没有
钻研过它所做的更“神奇”的事情。在我想要通过的测试(可能会内省一些
对象
)中,有一个名为testdir的参数,但是在这个文件中
没有
任何地方引用testdir是什么,或者我可能如何构造一个
对象
。看看testdir
对象
所做的事情,它看
浏览 2
提问于2017-09-17
得票数 1
回答已采纳
2
回答
如何使用Automator运行python脚本来查看调试/错误消息?
python
、
shell
、
terminal
、
automator
如果由于发生异常而导致脚本执行失败,Automator将返回错误,但不会显示任何内容:Traceback (most recent call last): 有
没有
办法运行
浏览 0
提问于2014-04-29
得票数 3
1
回答
python有检查
对象
是否有
属性
的速记吗?
python
、
string
、
python-3.x
、
if-statement
、
conditional-operator
编辑:,因为它似乎是相关的:我试图处理的
对象
来自Telegram的JSON。我使用python-telegram-bot作为库,是一个示例
对象
。
浏览 0
提问于2018-08-16
得票数 7
回答已采纳
点击加载更多
热门
标签
更多标签
云服务器
对象存储
ICP备案
云点播
腾讯会议
活动推荐
运营活动
广告
关闭
领券