From c72ec5c0296165b7430f8562826e18e75274998b Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 15 Dec 2019 15:05:18 +0300 Subject: [PATCH] unittest: TestSuite: Add undescore to internal field, self._tests. To avoid possible name clashes. Signed-off-by: Paul Sokolovsky --- python-stdlib/unittest/unittest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python-stdlib/unittest/unittest.py b/python-stdlib/unittest/unittest.py index a3e058b1..e0c463ff 100644 --- a/python-stdlib/unittest/unittest.py +++ b/python-stdlib/unittest/unittest.py @@ -170,16 +170,16 @@ def skipUnless(cond, msg): class TestSuite: def __init__(self): - self.tests = [] + self._tests = [] def addTest(self, cls): - self.tests.append(cls) + self._tests.append(cls) class TestRunner: def run(self, suite): res = TestResult() - for c in suite.tests: + for c in suite._tests: res.exceptions.extend(run_class(c, res)) print("Ran %d tests\n" % res.testsRun)