pylint
pylint copied to clipboard
Pylint doesn't detect AttributeError when using PyQt5
Steps to reproduce
- Create a new directory and initiate a virtual environment in that directory using virtualenv
- Install pylint and PyQt5 using the venv's pip
- Create an rcfile for pylint (using pylint --generate-rcfile) and add PyQt5 to the extension-pkg-whitelist
- Write some code in python requesting an attribute that doesn't exist e.g.
import sys
from PyQt5 import QtWidgets
def create_window():
app = QtWidgets.QApplication(sys.argv)
window = QtWidgets.QWidget()
window.definitely_not_one_of_its_attributes()
window.show()
create_window()
Current behavior
When running pylint on the file it informs me that my code has been rated at 6.67/10.0 and that other than some missing docstrings there are no errors.
Expected behavior
Pylint should tell me that 'definitely_not_one_of_its_attributes' isn't an attribute of QWidget, which is the error message that I get when I try to run the code.
pylint --version output
pylint 2.1.1 astroid 2.0.4 Python 3.7.0 (default, Aug 22 2018, 15:22:33) [Clang 9.1.0 (clang-902.0.39.2)]
Thanks, will check why we don't emit for this.