Skip to content

Commit dc43f79

Browse files
committed
fix duplicates in --list-all-tests
The test scanning unittest.Testloader.discover() seems pick up on other test classes being imported directly into the top level: ./op-test --list-all-tests|grep test_raw|grep InbandIPMI OpTestInbandIPMI.OpTestInbandIPMI.test_raw OpTestInbandIPMI.SkirootFullInbandIPMI.test_raw testcases.OpTestInbandIPMI.OpTestInbandIPMI.test_raw testcases.OpTestInbandIPMI.SkirootFullInbandIPMI.test_raw Fix this by making the OpTestInbandUsbInterface import OpTestInbandIPMI as a module rather than importing the classes from the module into its top level namespace. Signed-off-by: Oliver O'Halloran <[email protected]>
1 parent 1a4e977 commit dc43f79

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

testcases/OpTestInbandUsbInterface.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@
5151

5252
import OpTestConfiguration
5353
from common.OpTestSystem import OpSystemState
54-
from testcases.OpTestInbandIPMI import BasicInbandIPMI, OpTestInbandIPMI, ExperimentalInbandIPMI
55-
from testcases.OpTestInbandIPMI import SkirootBasicInbandIPMI, SkirootFullInbandIPMI
54+
import testcases.OpTestInbandIPMI as ib
5655

5756

5857
def experimental_suite():
@@ -71,7 +70,7 @@ def skiroot_full_suite():
7170
return unittest.defaultTestLoader.loadTestsFromTestCase(SkirootInbandUSB)
7271

7372

74-
class BasicInbandUSB(BasicInbandIPMI):
73+
class BasicInbandUSB(ib.BasicInbandIPMI):
7574
def setUp(self, ipmi_method=BMC_CONST.IPMITOOL_USB):
7675
self.bmc_type = OpTestConfiguration.conf.args.bmc_type
7776
if "FSP" in self.bmc_type:
@@ -81,7 +80,7 @@ def setUp(self, ipmi_method=BMC_CONST.IPMITOOL_USB):
8180
super(BasicInbandUSB, self).setUp(ipmi_method=ipmi_method)
8281

8382

84-
class InbandUSB(OpTestInbandIPMI):
83+
class InbandUSB(ib.OpTestInbandIPMI):
8584
def setUp(self, ipmi_method=BMC_CONST.IPMITOOL_USB):
8685
self.bmc_type = OpTestConfiguration.conf.args.bmc_type
8786
if "FSP" in self.bmc_type:
@@ -91,7 +90,7 @@ def setUp(self, ipmi_method=BMC_CONST.IPMITOOL_USB):
9190
super(InbandUSB, self).setUp(ipmi_method=ipmi_method)
9291

9392

94-
class SkirootBasicInbandUSB(SkirootBasicInbandIPMI):
93+
class SkirootBasicInbandUSB(ib.SkirootBasicInbandIPMI):
9594
def setUp(self, ipmi_method=BMC_CONST.IPMITOOL_USB):
9695
self.bmc_type = OpTestConfiguration.conf.args.bmc_type
9796
if "FSP" in self.bmc_type:
@@ -101,7 +100,7 @@ def setUp(self, ipmi_method=BMC_CONST.IPMITOOL_USB):
101100
super(SkirootBasicInbandUSB, self).setUp(ipmi_method=ipmi_method)
102101

103102

104-
class SkirootInbandUSB(SkirootFullInbandIPMI):
103+
class SkirootInbandUSB(ib.SkirootFullInbandIPMI):
105104
def setUp(self, ipmi_method=BMC_CONST.IPMITOOL_USB):
106105
self.bmc_type = OpTestConfiguration.conf.args.bmc_type
107106
if "FSP" in self.bmc_type:
@@ -111,7 +110,7 @@ def setUp(self, ipmi_method=BMC_CONST.IPMITOOL_USB):
111110
super(SkirootInbandUSB, self).setUp(ipmi_method=ipmi_method)
112111

113112

114-
class ExperimentalInbandUSB(ExperimentalInbandIPMI):
113+
class ExperimentalInbandUSB(ib.ExperimentalInbandIPMI):
115114
def setUp(self, ipmi_method=BMC_CONST.IPMITOOL_USB):
116115
self.bmc_type = OpTestConfiguration.conf.args.bmc_type
117116
if "FSP" in self.bmc_type:

0 commit comments

Comments
 (0)