Skip to content

Commit

Permalink
Merge pull request #856 from hydrosquall/cameron.yick/remove-timezone…
Browse files Browse the repository at this point in the history
…-from-unit-tests

fix: remove timezone assertion from unit tests
  • Loading branch information
hydrosquall committed Apr 17, 2023
2 parents 7d4c380 + 8b632d6 commit 2954223
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
10 changes: 4 additions & 6 deletions tests/test_tiingo_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def test_return_pandas_daily_csv(self):
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

Expand All @@ -87,7 +86,6 @@ def test_return_pandas_daily_metric_name_csv(self):
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]
Expand All @@ -97,12 +95,12 @@ def test_return_pandas_daily_metric_name_csv(self):
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))
Expand Down

0 comments on commit 2954223

Please sign in to comment.