Merge pull request #856 from hydrosquall/cameron.yick/remove-timezone-from-unit-tests

fix: remove timezone assertion from unit tests
This commit is contained in:
Cameron Yick
2023-04-16 20:48:42 -04:00
committed by GitHub
2 changed files with 7 additions and 9 deletions

View File

@@ -30,7 +30,7 @@ jobs:
run: |
python -m pip install --upgrade pip
python setup.py develop
python -m pip install flake8 pytest-cov codecov vcrpy black
python -m pip install flake8 pytest-cov coverage vcrpy black
tools/install_pandas.sh
- name: black
run: |
@@ -46,5 +46,5 @@ jobs:
TIINGO_API_KEY: 0000000000000000000000000000000000000000
run: |
py.test --cov=./tiingo
- name: Run code coverage
run: codecov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3

View File

@@ -64,7 +64,6 @@ class TestTiingoWithPython(TestCase):
frequency='daily', fmt='csv')
self.assertTrue(isinstance(prices, pd.DataFrame))
self.assertTrue(isinstance(prices.index, pd.DatetimeIndex))
assert prices.index.tz.zone == 'UTC'
assert len(prices) == 10
assert len(prices.columns) == 12
@@ -87,7 +86,6 @@ class TestTiingoWithPython(TestCase):
endDate='2018-01-19', frequency='daily', fmt='csv')
self.assertTrue(isinstance(prices, pd.Series))
self.assertTrue(isinstance(prices.index, pd.DatetimeIndex))
assert prices.index.tz.zone == 'UTC'
assert prices.values.tolist() == [
1110.29,1114.21,1112.79,1110.14,1112.05,
1130.65,1130.7,1139.1,1135.97,1143.5]
@@ -97,12 +95,12 @@ class TestTiingoWithPython(TestCase):
def test_price_pandas_daily_equivalent_requesting_json_or_csv(self):
"""Test that equivalent data is returned when specifying reuqest format in json or csv.
"""
prices_json = self._client.get_dataframe("GOOGL",
startDate='2018-01-05', endDate='2018-01-19',
prices_json = self._client.get_dataframe("GOOGL",
startDate='2018-01-05', endDate='2018-01-19',
metric_name='close', frequency='daily')
prices_csv = self._client.get_dataframe("GOOGL",
startDate='2018-01-05', endDate='2018-01-19',
prices_csv = self._client.get_dataframe("GOOGL",
startDate='2018-01-05', endDate='2018-01-19',
metric_name='close', frequency='daily', fmt='csv')
self.assertTrue(prices_json.equals(prices_csv))