次のコードを使用します。
import pytest
def test_a():
with pytest.raises(Exception):
1/0
その上で pylint を実行すると、「レイズ」がモジュール pytest のメンバーではないことを訴えます。
E: 3,9:test_a: Module 'pytest' has no 'raises' member
これは明らかに真実ではありません。なぜpylintがそのような間違いを犯しているのか、何か考えはありますか? これは既知のバグですか?
py.test バージョン:
> py.test --version
This is py.test version 2.2.3, imported from C:\Python27\lib\site-packages\pytest.pyc
PyLint バージョン:
> pylint --version
No config file found, using default configuration
pylint 0.25.1,
astng 0.23.1, common 0.57.1
Python 2.7.2 (default, Jun 24 2011, 12:22:14) [MSC v.1500 64 bit (AMD64)]