MCPcopy Create free account
hub / github.com/ccxt/ccxt / test_proxies

Method test_proxies

python/ccxt/test/tests_async.py:626–648  ·  view source on GitHub ↗
(self, exchange)

Source from the content-addressed store, hash-verified

624 await self.run_tests(exchange, tests, False)
625
626 async def test_proxies(self, exchange):
627 # these tests should be synchronously executed, because of conflicting nature of proxy settings
628 proxy_test_name = self.proxy_test_file_name
629 # todo: temporary skip for sync py
630 if self.ext == 'py' and is_sync():
631 return True
632 # try proxy several times
633 max_retries = 3
634 exception = None
635 for j in range(0, max_retries):
636 try:
637 await self.test_method(proxy_test_name, exchange, [], True)
638 return True # if successfull, then end the test
639 except Exception as e:
640 exception = e
641 await exchange.sleep(j * 1000)
642 # if exception was set, then throw it
643 if exception is not None:
644 error_message = '[TEST_FAILURE] Failed ' + proxy_test_name + ' : ' + exception_message(exception)
645 # temporary comment the below, because c# transpilation failure
646 # throw new Exchange Error (errorMessage.toString ());
647 dump('[TEST_WARNING]' + error_message)
648 return True
649
650 def check_constructor(self, exchange):
651 # todo: this might be moved in base tests later

Callers

nothing calls this directly

Calls 6

test_methodMethod · 0.95
is_syncFunction · 0.90
exception_messageFunction · 0.90
dumpFunction · 0.90
rangeFunction · 0.50
sleepMethod · 0.45

Tested by

no test coverage detected