aip/get_token_test.py::TestCaseGetToken::test_start c:\python37\lib\site-packages\_pytest\python.py:200: PytestReturnNotNoneWarning: Expected None, but aip/get_token_test.py::TestCaseGetToken::test_start returned <aip. get_token_test.TestCaseGetToken object at 0x00000250F06F7A08>, which will be an error in a future version of pytest. Did you mean to use `assert` instead of `return`? f"Expected None, but {pyfuncitem.nodeid} returned {result!r}, which will be an error in a " -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
时间: 2024-03-15 20:41:51 浏览: 25
这是一个关于 pytest 的警告信息,提示开发者在测试用例中使用 `assert` 语句而不是 `return` 语句,以避免在未来版本中产生错误。具体来说,这个警告是在运行 `aip/get_token_test.py` 文件中的 `TestCaseGetToken::test_start` 测试用例时产生的。
相关问题
ERROR: not found: C:\Users\27913\Desktop\web-framework-master\aip\get_token_test.py::TestCaseGetToken (no name 'C:\\Users\\27913\\Desktop\\web-framework-master\\aip\\get_token_test.py::TestCaseGetToken' in any of [<Module get_token_test.py>])
这个错误提示意味着 Python 找不到你尝试运行的测试用例。具体原因可能是测试用例文件中没有名为 `TestCaseGetToken` 的测试用例,或者测试用例文件的路径不正确。
你可以检查一下测试用例文件的路径是否正确,并且确认一下测试用例文件中是否存在名为 `TestCaseGetToken` 的测试用例。如果测试用例文件路径正确,但是测试用例文件中没有名为 `TestCaseGetToken` 的测试用例,那么你需要创建一个名为 `TestCaseGetToken` 的测试用例,并且在其中编写你的测试代码。
ImportError while importing test module 'C:\Users\27913\Desktop\web-framework-master\aip\get_token_test.py'. Hint: make sure your test modules/packages have valid Python names.
这个错误提示表明在导入测试模块时发生了错误,并且建议你确保测试模块具有有效的 Python 名称。通常情况下,Python 模块的名称应该是有效的标识符,不能包含空格、破折号、点号等特殊字符。你可以检查一下你的测试模块名称是否符合这些规则,另外还需要确保测试模块所在的路径已经添加到了 Python 解释器的搜索路径中。