diff options
author | Mats Wichmann <mats@linux.com> | 2019-08-16 14:19:20 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2022-03-15 14:39:44 (GMT) |
commit | ff81eebb73825091051e5ee846d0d89c60798112 (patch) | |
tree | bb02c3ff5d48f0322c0b5fbf2c14b1c7ae2f6908 /testing/framework | |
parent | 57369e87ba560f941e645e9d2ed194bd4a26dad5 (diff) | |
download | SCons-ff81eebb73825091051e5ee846d0d89c60798112.zip SCons-ff81eebb73825091051e5ee846d0d89c60798112.tar.gz SCons-ff81eebb73825091051e5ee846d0d89c60798112.tar.bz2 |
Use super call instead of direct class call
- super used where direct call to superclass existed
- convert a few older-style super() (two-argument) uses
- in a few places, where there was an intersection with a super change,
variables that override a builtin (e.g. "dict") were renamed.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'testing/framework')
-rw-r--r-- | testing/framework/TestCommon.py | 2 | ||||
-rw-r--r-- | testing/framework/TestRuntest.py | 2 | ||||
-rw-r--r-- | testing/framework/TestSCons.py | 4 | ||||
-rw-r--r-- | testing/framework/TestSCons_time.py | 2 | ||||
-rw-r--r-- | testing/framework/TestSConsign.py | 2 | ||||
-rw-r--r-- | testing/framework/TestUnit/taprunner.py | 14 |
6 files changed, 13 insertions, 13 deletions
diff --git a/testing/framework/TestCommon.py b/testing/framework/TestCommon.py index 2eeaad0..1999f74 100644 --- a/testing/framework/TestCommon.py +++ b/testing/framework/TestCommon.py @@ -261,7 +261,7 @@ class TestCommon(TestCmd): calling the base class initialization, and then changing directory to the workdir. """ - TestCmd.__init__(self, **kw) + super().__init__(**kw) os.chdir(self.workdir) def options_arguments(self, options, arguments): diff --git a/testing/framework/TestRuntest.py b/testing/framework/TestRuntest.py index 18dcb94..9368953 100644 --- a/testing/framework/TestRuntest.py +++ b/testing/framework/TestRuntest.py @@ -146,7 +146,7 @@ class TestRuntest(TestCommon): del kw['things_to_copy'] orig_cwd = os.getcwd() - TestCommon.__init__(self, **kw) + super().__init__(**kw) dirs = [os.environ.get('SCONS_RUNTEST_DIR', orig_cwd)] diff --git a/testing/framework/TestSCons.py b/testing/framework/TestSCons.py index 0bf6abd..079e17d 100644 --- a/testing/framework/TestSCons.py +++ b/testing/framework/TestSCons.py @@ -321,7 +321,7 @@ class TestSCons(TestCommon): if kw.get('ignore_python_version', -1) != -1: del kw['ignore_python_version'] - TestCommon.__init__(self, **kw) + super().__init__(**kw) if not self.external: import SCons.Node.FS @@ -1755,7 +1755,7 @@ class TimeSCons(TestSCons): if 'verbose' not in kw and not self.calibrate: kw['verbose'] = True - TestSCons.__init__(self, *args, **kw) + super().__init__(*args, **kw) # TODO(sgk): better way to get the script dir than sys.argv[0] self.test_dir = os.path.dirname(sys.argv[0]) diff --git a/testing/framework/TestSCons_time.py b/testing/framework/TestSCons_time.py index a57ca88..e647fe2 100644 --- a/testing/framework/TestSCons_time.py +++ b/testing/framework/TestSCons_time.py @@ -199,7 +199,7 @@ class TestSCons_time(TestCommon): if 'workdir' not in kw: kw['workdir'] = '' - TestCommon.__init__(self, **kw) + super().__init__(**kw) def archive_split(self, path): if path[-7:] == '.tar.gz': diff --git a/testing/framework/TestSConsign.py b/testing/framework/TestSConsign.py index 699e929..b0562bf 100644 --- a/testing/framework/TestSConsign.py +++ b/testing/framework/TestSConsign.py @@ -64,7 +64,7 @@ class TestSConsign(TestSCons): os.chdir(script_dir) self.script_dir = os.getcwd() - TestSCons.__init__(self, *args, **kw) + super().__init__(*args, **kw) self.my_kw = { 'interpreter' : python, # imported from TestSCons diff --git a/testing/framework/TestUnit/taprunner.py b/testing/framework/TestUnit/taprunner.py index 0dde327..001db5c 100644 --- a/testing/framework/TestUnit/taprunner.py +++ b/testing/framework/TestUnit/taprunner.py @@ -43,29 +43,29 @@ class TAPTestResult(TextTestResult): self.stream.flush() def addSuccess(self, test): - super(TextTestResult, self).addSuccess(test) + super().addSuccess(test) self._process(test, "ok") def addFailure(self, test, err): - super(TextTestResult, self).addFailure(test, err) + super().addFailure(test, err) self._process(test, "not ok", "FAIL") # [ ] add structured data about assertion def addError(self, test, err): - super(TextTestResult, self).addError(test, err) + super().addError(test, err) self._process(test, "not ok", "ERROR") # [ ] add structured data about exception def addSkip(self, test, reason): - super(TextTestResult, self).addSkip(test, reason) + super().addSkip(test, reason) self._process(test, "ok", directive=(" # SKIP %s" % reason)) def addExpectedFailure(self, test, err): - super(TextTestResult, self).addExpectedFailure(test, err) + super().addExpectedFailure(test, err) self._process(test, "not ok", directive=" # TODO") def addUnexpectedSuccess(self, test): - super(TextTestResult, self).addUnexpectedSuccess(test) + super().addUnexpectedSuccess(test) self._process(test, "not ok", "FAIL (unexpected success)") """ @@ -90,7 +90,7 @@ class TAPTestRunner(TextTestRunner): for case in test: case.suite = test - return super(TAPTestRunner, self).run(test) + return super().run(test) if __name__ == "__main__": |