Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/364.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 我可以得到一份所有鼻子属性的列表吗?_Python_Attributes_Nose - Fatal编程技术网

Python 我可以得到一份所有鼻子属性的列表吗?

Python 我可以得到一份所有鼻子属性的列表吗?,python,attributes,nose,Python,Attributes,Nose,我需要两样东西 我希望能够随意添加属性,而无需添加!attr用于每个ToMy nosetests调用(我已经连接到Vim中的映射)。我在想类似于鼻测试的东西——一个‘无’,但我找不到这样的选项 我还希望能够发现我添加了哪些属性,因此我可以在Vim中建立一个小列表/切换机制,以便轻松切换测试的开和关 这就是你要找的吗 from nose.plugins.attrib import attr ... @attr(id='VD-333', type=('Functional', 'Negative')

我需要两样东西

  • 我希望能够随意添加属性,而无需添加
    !attr
    用于每个ToMy nosetests调用(我已经连接到Vim中的映射)。我在想类似于鼻测试的东西——一个‘无’,但我找不到这样的选项

  • 我还希望能够发现我添加了哪些属性,因此我可以在Vim中建立一个小列表/切换机制,以便轻松切换测试的开和关


  • 这就是你要找的吗

    from nose.plugins.attrib import attr
    ...
    @attr(id='VD-333', type=('Functional', 'Negative'))
    def test_invalid_where_with_field_alone(self):
        import pdb; pdb.set_trace()
    ...
    (Pdb++) self._testMethodName
    'test_invalid_where_with_field_alone'
    (Pdb++) y=getattr(self, self._testMethodName)
    (Pdb++) y.id
    'VD-333'