什么是正确使用nose.tools并使pylint开心的正确方法?
如下代码:
'''
This is a test
'''
import nose.tools
import nose.tools.trivial
nose.tools.assert_equal(1, 1)
nose.tools.assert_equals(1, 1)
nose.tools.trivial.assert_equal(1, 1)
nose.tools.trivial.assert_equals(1, 1)
导致以下pylint错误:
$ pylint -i y -r n /tmp/aseq.py
************* Module aseq
E1101: 8,0: Module 'nose.tools' has no 'assert_equal' member
E1101: 9,0: Module 'nose.tools' has no 'assert_equals' member
E1101: 11,0: Module 'nose.tools.trivial' has no 'assert_equal' member
E1101: 12,0: Module 'nose.tools.trivial' has no 'assert_equals' member
当然,可以禁用E1101,有没有更清洁的方法?
相关分类