python - Pytest 不会运行任何测试
问题描述
我无法让 pytest 在 Python 3.6 上运行测试,因此我卸载并重新安装了 Python 3.7。然后我使用 pip 下载了 pytest 和 pep8 并添加了
C:\Users\CoolT\AppData\Local\Programs\Python\Python37-32\Scripts
到路径。现在我无法让 pytest 运行任何东西。
py.test
并且python
命令提示符命令不起作用,当我尝试运行测试时,会发生以下情况:
C:\Users\coolt\mymodules>py -3 -m pytest vsearch.py
C:\Users\coolt\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pep8.py:110: FutureWarning: Possible nested set at position 1
EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')
================================================= test session starts =================================================
platform win32 -- Python 3.7.2, pytest-4.1.1, py-1.7.0, pluggy-0.8.1
rootdir: C:\Users\coolt\mymodules, inifile:
plugins: pep8-1.0.6
collected 0 items
============================================ no tests ran in 0.18 seconds =============================================
关于如何解决我的问题的任何想法?
解决方案
我设法通过要求它进行 pep8 检查来运行测试。我在命令提示符下以管理员身份运行它:
py -3 -m pytest --pep8 vsearch.py
推荐阅读
- gremlin - Gremlin - 计算两个属性不同的边数
- python-3.x - python - 如何将两个列表列表组合成python中的pandas DataFrame?
- java - Spark Java 重新分区
- reactjs - 如何重构这个组件以避免重复?
- react-native - 如何在 react-native 中定位选项卡导航器
- python - Visual C++ Redistributable 2015 已删除且无法重新安装
- google-chrome-extension - 是否需要 Google 开发人员费用才能将网络扩展程序上传到 Google 的网上商店
- c# - 如何自动重叠位于不同位置/比例/旋转的 2 个相等对象?
- html - 如何将 iframe 居中并使其响应移动设备?
- excel - Excel:CountIf 单元格以某些数字开头