• py.test --pep8 vsearch.py报错解决办法


    py.test --pep8 vsearch.py报错解决办法

    使用pep8 vsearch.py替换py.test --pep8 vsearch.py即可。

    pep8 has been renamed to pycodestyle (GitHub issue #466)
    Use of the pep8 tool will be removed in a future release.
    Please install and use `pycodestyle` instead.

    $ pip install pycodestyle
    $ pycodestyle ...

    测试结果如下:
    D:\PythonProjects\pythonstudy\ch04>py.test --pep8 vsearch22.py
    d:\program files\python38\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.8.10, pytest-7.1.3, pluggy-1.0.0
    rootdir: D:\PythonProjects\pythonstudy\ch04
    plugins: pep8-1.0.6
    collected 0 items

    ============================ no tests ran in 0.04s ============================
    ERROR: file or directory not found: vsearch22.py


    D:\PythonProjects\pythonstudy\ch04>
    D:\PythonProjects\pythonstudy\ch04>py.test --pep8 vsearch2.py
    d:\program files\python38\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.8.10, pytest-7.1.3, pluggy-1.0.0
    rootdir: D:\PythonProjects\pythonstudy\ch04
    plugins: pep8-1.0.6
    collected 0 items / 1 error

    =================================== ERRORS ====================================
    ________________________ ERROR collecting test session ________________________
    Direct construction of pytest_pep8.Pep8Item has been deprecated, please use pyte
    st_pep8.Pep8Item.from_parent.
    See https://docs.pytest.org/en/stable/deprecations.html#node-construction-change
    d-to-node-from-parent for more details.
    =========================== short test summary info ===========================
    ERROR
    !!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
    ============================== 1 error in 0.33s ===============================

    D:\PythonProjects\pythonstudy\ch04>
    D:\PythonProjects\pythonstudy\ch04>
    D:\PythonProjects\pythonstudy\ch04>
    D:\PythonProjects\pythonstudy\ch04>
    D:\PythonProjects\pythonstudy\ch04>
    D:\PythonProjects\pythonstudy\ch04>pytest --version
    d:\program files\python38\lib\site-packages\pep8.py:110: FutureWarning: Possible
     nested set at position 1
      EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')
    pytest 7.1.3

    D:\PythonProjects\pythonstudy\ch04>
    D:\PythonProjects\pythonstudy\ch04>
    D:\PythonProjects\pythonstudy\ch04>
    D:\PythonProjects\pythonstudy\ch04>
    D:\PythonProjects\pythonstudy\ch04>
    D:\PythonProjects\pythonstudy\ch04>
    D:\PythonProjects\pythonstudy\ch04>
    D:\PythonProjects\pythonstudy\ch04>
    D:\PythonProjects\pythonstudy\ch04>py -3 -m pytest pep8 vsearch2.py
    D:\Program Files\Python38\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.8.10, pytest-7.1.3, pluggy-1.0.0
    rootdir: D:\PythonProjects\pythonstudy\ch04
    plugins: pep8-1.0.6
    collected 0 items

    ============================ no tests ran in 0.05s ============================
    ERROR: file or directory not found: pep8


    D:\PythonProjects\pythonstudy\ch04>py -3 -m pytest --pep8 vsearch2.py
    D:\Program Files\Python38\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.8.10, pytest-7.1.3, pluggy-1.0.0
    rootdir: D:\PythonProjects\pythonstudy\ch04
    plugins: pep8-1.0.6
    collected 0 items / 1 error

    =================================== ERRORS ====================================
    ________________________ ERROR collecting test session ________________________
    Direct construction of pytest_pep8.Pep8Item has been deprecated, please use pyte
    st_pep8.Pep8Item.from_parent.
    See https://docs.pytest.org/en/stable/deprecations.html#node-construction-change
    d-to-node-from-parent for more details.
    =========================== short test summary info ===========================
    ERROR
    !!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
    ============================== 1 error in 0.35s ===============================

    D:\PythonProjects\pythonstudy\ch04>
    D:\PythonProjects\pythonstudy\ch04>
    D:\PythonProjects\pythonstudy\ch04>
    D:\PythonProjects\pythonstudy\ch04>
    D:\PythonProjects\pythonstudy\ch04>
    D:\PythonProjects\pythonstudy\ch04>pep8 vsearch2.py
    d:\program files\python38\lib\site-packages\pep8.py:110: FutureWarning: Possible
     nested set at position 1
      EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')
    d:\program files\python38\lib\site-packages\pep8.py:2123: UserWarning:

    pep8 has been renamed to pycodestyle (GitHub issue #466)
    Use of the pep8 tool will be removed in a future release.
    Please install and use `pycodestyle` instead.

    $ pip install pycodestyle
    $ pycodestyle ...

      warnings.warn(
    vsearch2.py:5:11: E225 missing whitespace around operator
    vsearch2.py:9:31: E231 missing whitespace after ','
    vsearch2.py:12:1: W391 blank line at end of file

    D:\PythonProjects\pythonstudy\ch04>
    D:\PythonProjects\pythonstudy\ch04>
    D:\PythonProjects\pythonstudy\ch04>
     

  • 相关阅读:
    JAVA生成安全认证证书
    Linux友好度太低?试试Clion远程开发|ssh连接远程主机
    2022-08-07 集合拓展---遍历
    Excel加密,记住4个方法,轻松保护数据!
    接口自动化平台—企业级项目
    周报不止是汇报进度,如何用周报轻松提升团队协作效率?
    技术学习:Python(21)|爬虫篇|selenium自动化操作浏览器
    小程序全局配置文件以及常用配置项
    使用flask实现一个简单的代理服务
    学习springboot杂乱无章的笔记
  • 原文地址:https://blog.csdn.net/halou90/article/details/126724314