From b03f2a307dfdaafc1597035ef669b14da0d55f77 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 2 Apr 2018 13:40:14 +0200 Subject: [PATCH] Small refactor for `super` use --- ccxt_wrapper.py | 6 +++--- test.py | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ccxt_wrapper.py b/ccxt_wrapper.py index 97f359f..260d49d 100644 --- a/ccxt_wrapper.py +++ b/ccxt_wrapper.py @@ -21,7 +21,7 @@ class poloniexE(poloniex): Wrapped to allow retry of non-posting requests" """ - origin_request = super(poloniexE, self).request + origin_request = super().request kwargs = { "api": api, "method": method, @@ -38,7 +38,7 @@ class poloniexE(poloniex): return origin_request(path, **kwargs) def __init__(self, *args, **kwargs): - super(poloniexE, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) # For requests logging self.session.origin_request = self.session.request @@ -223,7 +223,7 @@ class poloniexE(poloniex): return all_balances def create_exchange_order(self, symbol, type, side, amount, price=None, params={}): - return super(poloniexE, self).create_order(symbol, type, side, amount, price=price, params=params) + return super().create_order(symbol, type, side, amount, price=price, params=params) def create_margin_order(self, symbol, type, side, amount, price=None, lending_rate=None, params={}): if type == 'market': diff --git a/test.py b/test.py index c229801..9ea9df4 100644 --- a/test.py +++ b/test.py @@ -27,7 +27,7 @@ class WebMockTestCase(unittest.TestCase): return type('Args', (object,), { "debug": debug, "quiet": quiet })() def setUp(self): - super(WebMockTestCase, self).setUp() + super().setUp() self.wm = requests_mock.Mocker() self.wm.start() @@ -55,12 +55,12 @@ class WebMockTestCase(unittest.TestCase): for patcher in self.patchers: patcher.stop() self.wm.stop() - super(WebMockTestCase, self).tearDown() + super().tearDown() @unittest.skipUnless("unit" in limits, "Unit skipped") class poloniexETest(unittest.TestCase): def setUp(self): - super(poloniexETest, self).setUp() + super().setUp() self.wm = requests_mock.Mocker() self.wm.start() @@ -68,7 +68,7 @@ class poloniexETest(unittest.TestCase): def tearDown(self): self.wm.stop() - super(poloniexETest, self).tearDown() + super().tearDown() def test__init(self): with mock.patch("market.ccxt.poloniexE.session") as session: @@ -609,7 +609,7 @@ class LockedVar(unittest.TestCase): @unittest.skipUnless("unit" in limits, "Unit skipped") class PortfolioTest(WebMockTestCase): def setUp(self): - super(PortfolioTest, self).setUp() + super().setUp() with open("test_samples/test_portfolio.json") as example: self.json_response = example.read() @@ -1154,7 +1154,7 @@ class BalanceTest(WebMockTestCase): @unittest.skipUnless("unit" in limits, "Unit skipped") class MarketTest(WebMockTestCase): def setUp(self): - super(MarketTest, self).setUp() + super().setUp() self.ccxt = mock.Mock(spec=market.ccxt.poloniexE) @@ -2056,7 +2056,7 @@ class TradeStoreTest(WebMockTestCase): @unittest.skipUnless("unit" in limits, "Unit skipped") class BalanceStoreTest(WebMockTestCase): def setUp(self): - super(BalanceStoreTest, self).setUp() + super().setUp() self.fetch_balance = { "ETC": { -- 2.41.0