鼻子工具和针

什么是正确使用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,有没有更清洁的方法?


慕雪6442864
浏览 132回答 3
3回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python