• 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>
     

  • 相关阅读:
    简易实现QT中的virtualkeyboard及问题总结
    Redis 缓存穿透击穿和雪崩
    react+ts实战之 @reduxjs/toolkit
    Android ADB 常见问题和注意事项
    USER_TABLE中的num_rows与 count(1)不一致的问题
    Go by Example for循环
    SVM(上):如何用一根棍子将蓝红两色球分开?
    C++:从初识到初识的旅程
    高精度算法【Java】(待更新中~)
    科技互联网领域,怎样才算突破性创新?
  • 原文地址:https://blog.csdn.net/halou90/article/details/126724314