Why there are two kinds of unit test class?

Asked by Tong Da

Hi,

When I was reading source code of nova, I found that there are two kinds of unit test class. One starts with "TestXXX", the other ends with "XXXTestCase". For example:

1. in nova.tests.unit.image.test_transfer_modules, there is a test class defination:

class TestFileTransferModule(test.NoDBTestCase):

2. in nova.tests.unit.volume.test_cinder, there is a test class defination:

class CinderApiTestCase(test.NoDBTestCase):

Since these two class are both inherited form test.NoDBTestCase, I think they should follow a consistent naming style.

This do not cause any problem except that when I want to run unit test in PyCharm by right click the class name. PyCharm can only automatically recognise the "TestXXX" and run it as unit test.

Could anyone explain whether this i by design or not?

Question information

Language:
English Edit question
Status:
Expired
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.