Pylint complains about py.test: "The pytest module does not have a raises member

With the following code:

import pytest
def test_a():
    with pytest.raises(Exception):
        1/0

If I run pylint on it, it will complain that the "raises" are not members of the pytest module:

E:  3,9:test_a: Module 'pytest' has no 'raises' member

This is obviously not true. Any idea why the pilint makes such a mistake? Is this a known bug?

py.test version:

> py.test --version
This is py.test version 2.2.3, imported from C:\Python27\lib\site-packages\pytest.pyc

PyLint Version:

> 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)]
+5
source share
2 answers

, , pylib python , . , pylint/astng , pytest: pylint/astng , , , , , , , , , , .

:

  • unittest, , py.test
  • / .
  • linter, , pylint py.test( , pychecker/pyflakes )
  • astng, astng grok the pylib tricks ( ).
+3

pylintrc : ignored-classes=pytest

+3

All Articles