擅长:python、mysql、java
<pre><code>self.id().split('.')[-1]
</code></pre>
<p>您可以在以下位置找到文档:
<a href="http://docs.python.org/library/unittest.html#unittest.TestCase.id" rel="nofollow noreferrer">http://docs.python.org/library/unittest.html#unittest.TestCase.id</a></p>
<p>编辑:
对于2.7个用户,
<a href="https://docs.python.org/2.7/library/unittest.html#unittest.TestCase.id" rel="nofollow noreferrer">https://docs.python.org/2.7/library/unittest.html#unittest.TestCase.id</a></p>