From d6eaf7c0183cd04b78f2a55e1d60bb7e59598310 Mon Sep 17 00:00:00 2001 From: chillaranand Date: Sat, 21 Jan 2017 18:43:44 +0530 Subject: Refs #23919 -- Replaced super(ClassName, self) with super(). --- tests/utils_tests/test_lazyobject.py | 7 ++++--- tests/utils_tests/test_module_loading.py | 4 ++-- tests/utils_tests/test_numberformat.py | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'tests/utils_tests') diff --git a/tests/utils_tests/test_lazyobject.py b/tests/utils_tests/test_lazyobject.py index 11bf163747..4a4e929cda 100644 --- a/tests/utils_tests/test_lazyobject.py +++ b/tests/utils_tests/test_lazyobject.py @@ -366,7 +366,7 @@ class BaseBaz: def __reduce__(self): self.baz = 'right' - return super(BaseBaz, self).__reduce__() + return super().__reduce__() def __eq__(self, other): if self.__class__ != other.__class__: @@ -385,11 +385,11 @@ class Baz(BaseBaz): """ def __init__(self, bar): self.bar = bar - super(Baz, self).__init__() + super().__init__() def __reduce_ex__(self, proto): self.quux = 'quux' - return super(Baz, self).__reduce_ex__(proto) + return super().__reduce_ex__(proto) class BazProxy(Baz): @@ -401,6 +401,7 @@ class BazProxy(Baz): def __init__(self, baz): self.__dict__ = baz.__dict__ self._baz = baz + # Grandparent super super(BaseBaz, self).__init__() diff --git a/tests/utils_tests/test_module_loading.py b/tests/utils_tests/test_module_loading.py index ad1135aa19..f66c167974 100644 --- a/tests/utils_tests/test_module_loading.py +++ b/tests/utils_tests/test_module_loading.py @@ -235,10 +235,10 @@ class CustomLoader(EggLoader): into one class, this isn't required. """ def setUp(self): - super(CustomLoader, self).setUp() + super().setUp() sys.path_hooks.insert(0, TestFinder) sys.path_importer_cache.clear() def tearDown(self): - super(CustomLoader, self).tearDown() + super().tearDown() sys.path_hooks.pop(0) diff --git a/tests/utils_tests/test_numberformat.py b/tests/utils_tests/test_numberformat.py index dd6057bb64..f78fc91087 100644 --- a/tests/utils_tests/test_numberformat.py +++ b/tests/utils_tests/test_numberformat.py @@ -64,7 +64,7 @@ class TestNumberFormat(TestCase): Wrapper for Decimal which prefixes each amount with the € symbol. """ def __format__(self, specifier, **kwargs): - amount = super(EuroDecimal, self).__format__(specifier, **kwargs) + amount = super().__format__(specifier, **kwargs) return '€ {}'.format(amount) price = EuroDecimal('1.23') -- cgit v1.3