mirror of
https://github.com/ranaroussi/yfinance.git
synced 2024-01-29 09:38:56 +03:00
Merge pull request #1793 from ranaroussi/fix/fetch-tkr-tz
Fix _get_ticker_tz() args, were being swapped. Improve its unit test
This commit is contained in:
@@ -86,7 +86,7 @@ class TestTicker(unittest.TestCase):
|
||||
|
||||
# Test:
|
||||
dat = yf.Ticker(tkr, session=self.session)
|
||||
tz = dat._get_ticker_tz(proxy=None, timeout=None)
|
||||
tz = dat._get_ticker_tz(proxy=None, timeout=5)
|
||||
|
||||
self.assertIsNotNone(tz)
|
||||
|
||||
|
||||
@@ -1650,7 +1650,7 @@ class TickerBase:
|
||||
|
||||
return df2
|
||||
|
||||
def _get_ticker_tz(self,timeout, proxy=None):
|
||||
def _get_ticker_tz(self, proxy, timeout):
|
||||
proxy = proxy or self.proxy
|
||||
if self._tz is not None:
|
||||
return self._tz
|
||||
@@ -1675,7 +1675,7 @@ class TickerBase:
|
||||
return tz
|
||||
|
||||
@utils.log_indent_decorator
|
||||
def _fetch_ticker_tz(self, timeout, proxy=None):
|
||||
def _fetch_ticker_tz(self, proxy, timeout):
|
||||
# Query Yahoo for fast price data just to get returned timezone
|
||||
proxy = proxy or self.proxy
|
||||
logger = utils.get_yf_logger()
|
||||
|
||||
Reference in New Issue
Block a user