第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

遵循 Head First Python 2nd edition 時出現(xiàn) Pytest-pep8

遵循 Head First Python 2nd edition 時出現(xiàn) Pytest-pep8

回首憶惘然 2022-05-11 15:21:40
我一直在關(guān)注 Head First Python 2nd Edition,在第 4 章中,演示了 pep8 合規(guī)性測試。盡管與書中的代碼相同,但我的輸出卻不同。測試代碼非常簡單:def search4vowels(phrase: str) -> set:    """Return vowels found in supplied phrase."""    vowels = set('aeiou')    return vowels.intersection(set(phrase))def search4letters(phrase: str, letters: str='aeiou') -> set:    """Return a set of 'letters' found in 'phrase'."""    return set(letters).intersection(set(phrase))我嘗試按照書中所示進行測試,并得到以下輸出:λ py.test.exe --pep8 vsearch.pyc:\users\gx\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.4, pytest-5.1.1, py-1.8.0, pluggy-0.12.0rootdir: C:\Users\gx\Desktop\H.F. Python\mymodulesplugins: pep8-1.0.6collected 1 itemvsearch.py .                                                             [100%]============================== warnings summary ===============================c:\users\gx\appdata\local\programs\python\python37-32\lib\site-packages\_pytest\mark\structures.py:324  c:\users\gx\appdata\local\programs\python\python37-32\lib\site-packages\_pytest\mark\structures.py:324:PytestUnknownMarkWarning: Unknown pytest.mark.pep8 - is this a typo?You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html    PytestUnknownMarkWarning,-- Docs: https://docs.pytest.org/en/latest/warnings.html======================== 1 passed, 1 warnings in 0.04s ========================(我稍微修改了空格以使其更具可讀性)書中沒有發(fā)生這樣的事情。在這樣做之前,我已經(jīng)全新安裝了 pytest 和 pytest-pep8,如書中所示。這是什么原因造成的?
查看完整描述

1 回答

?
絕地?zé)o雙

TA貢獻1946條經(jīng)驗 獲得超4個贊

這似乎是一個已知問題:#23。一種解決方法是在以下位置注冊pep8標(biāo)記pytest.ini:


[pytest]

markers =

    pep8: workaround for https://bitbucket.org/pytest-dev/pytest-pep8/issues/23/

或以編程方式注冊它conftest.py:


def pytest_configure(config):

    config.addinivalue_line(

        'markers', 'pep8: workaround for https://bitbucket.org/pytest-dev/pytest-pep8/issues/23/'

    )


查看完整回答
反對 回復(fù) 2022-05-11
  • 1 回答
  • 0 關(guān)注
  • 216 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號