cost 151 ms
ScopeMismatch 当我尝试进行 setup_teardown pytest function - ScopeMismatch when i try to make setup_teardown pytest function

我的目标是创建一个 fixture,它将在 class function 测试开始时运行一次,并初始化我需要的属性。 为此,我用 class 的 scope 创建了一个 fixture,并直接应用到 class。为了解决 pytest 与异步代码的兼容性问题,使用了 pytest-asyncio。 ...

pytest caplog LogCaptureFixture 在使用 logging.config.dictConfig() 时损坏 - pytest caplog LogCaptureFixture is broken when using logging.config.dictConfig()

几天来,我一直在围绕这个问题兜圈子,与开始时相比,我离解决方案还差得很远。 我已经审查了所有其他处理 pytest caplog fixture 的 stackoverflow 条目,我已经将我的问题缩小到使用logging.config.dictConfig() 我尝试了多种配置,有和没有prop ...

为什么 pytest 固定装置不能直接从测试中调用? - Why are pytest fixtures not meant to be called directly from within tests?

我了解 pytest 夹具在直接从测试中调用夹具时会引发错误。 但我不完全明白为什么。 对于上下文,我是 python 的初级开发人员,所以我可能遗漏了一些需要解释的明显内容。 我有一个夹具如下: 然后是一个测试,上面写着类似 我有许多不同的测试文件,它们将使用这个夹具 function 从文件中 ...

pytest 找不到夹具 - pytest not able to find fixture

嗨,我想为多个字符串多次执行“ test_supplier ”function。 如果我执行上面的代码,那么在执行测试之后我会在终端上得到以下错误 如果我取消注释“@pytest.fixture()” ,那么甚至无法启动测试并在终端上得到以下错误。 有人可以让我了解我在哪里做错了,所以可以纠正。 ...


排序:
质量:
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM