相关疑难解决方法(0)

鼻子工具和pylint

什么是使用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)
Run Code Online (Sandbox Code Playgroud)

导致以下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
Run Code Online (Sandbox Code Playgroud)

当然,有人可以禁用E1101,有更清洁的方式吗?

python testing pylint nose

5
推荐指数
1
解决办法
2646
查看次数

标签 统计

nose ×1

pylint ×1

python ×1

testing ×1