Skip to content

Commit c72ec5c

Browse files
pfalconpi-anl
authored andcommitted
unittest: TestSuite: Add undescore to internal field, self._tests.
To avoid possible name clashes. Signed-off-by: Paul Sokolovsky <[email protected]>
1 parent dc788f4 commit c72ec5c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python-stdlib/unittest/unittest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,16 +170,16 @@ def skipUnless(cond, msg):
170170

171171
class TestSuite:
172172
def __init__(self):
173-
self.tests = []
173+
self._tests = []
174174

175175
def addTest(self, cls):
176-
self.tests.append(cls)
176+
self._tests.append(cls)
177177

178178

179179
class TestRunner:
180180
def run(self, suite):
181181
res = TestResult()
182-
for c in suite.tests:
182+
for c in suite._tests:
183183
res.exceptions.extend(run_class(c, res))
184184

185185
print("Ran %d tests\n" % res.testsRun)

0 commit comments

Comments
 (0)