Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests failing #2112

Closed
dhruvan2006 opened this issue Nov 4, 2024 · 3 comments
Closed

Tests failing #2112

dhruvan2006 opened this issue Nov 4, 2024 · 3 comments

Comments

@dhruvan2006
Copy link
Contributor

Running python -m unittest discover -s tests from #1084 causes 5 failures and 1 error.

======================================================================
ERROR: test_resampling (test_price_repair.TestPriceRepairAssumptions.test_resampling)

Traceback (most recent call last):
File "/home/dhruvan/yfinance/tests/test_price_repair.py", line 49, in test_resampling
elif dfr.index[0] == df_truth.index[1]:
~~~~~~~~~~~~~~^^^
File "/home/dhruvan/yfinance/.venv/lib/python3.12/site-packages/pandas/core/indexes/base.py", line 5389, in getitem
return getitem(key)
^^^^^^^^^^^^
File "/home/dhruvan/yfinance/.venv/lib/python3.12/site-packages/pandas/core/arrays/datetimelike.py", line 381, in getitem
result = cast("Union[Self, DTScalarOrNaT]", super().getitem(key))
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dhruvan/yfinance/.venv/lib/python3.12/site-packages/pandas/core/arrays/_mixins.py", line 284, in getitem
result = self._ndarray[key]
~~~~~~~~~~~~~^^^^^
IndexError: index 1 is out of bounds for axis 0 with size 1

======================================================================
FAIL: test_repair_bad_div_adjusts (test_price_repair.TestPriceRepair.test_repair_bad_div_adjusts)

Traceback (most recent call last):
File "/home/dhruvan/yfinance/tests/test_price_repair.py", line 668, in test_repair_bad_div_adjusts
self.assertTrue(f_close.all())
AssertionError: np.False_ is not true

======================================================================
FAIL: test_repair_zeroes_daily (test_price_repair.TestPriceRepair.test_repair_zeroes_daily)

Traceback (most recent call last):
File "/home/dhruvan/yfinance/tests/test_price_repair.py", line 384, in test_repair_zeroes_daily
self.assertTrue(np.isclose(repaired_df[c], correct_df[c], rtol=1e-8).all())
AssertionError: np.False
is not true

======================================================================
FAIL: test_setTzCacheLocation (test_utils.TestCache.test_setTzCacheLocation)

Traceback (most recent call last):
File "/home/dhruvan/yfinance/tests/test_utils.py", line 52, in test_setTzCacheLocation
self.assertTrue(os.path.exists(os.path.join(self.tempCacheDir.name, "tkr-tz.db")))
AssertionError: False is not true

======================================================================
FAIL: test_tzCacheRootLookup (test_utils.TestCacheNoPermission.test_tzCacheRootLookup)

Traceback (most recent call last):
File "/home/dhruvan/yfinance/tests/test_utils.py", line 81, in test_tzCacheRootLookup
self.assertTrue(cache.dummy)
AssertionError: False is not true

======================================================================
FAIL: test_tzCacheRootStore (test_utils.TestCacheNoPermission.test_tzCacheRootStore)

Traceback (most recent call last):
File "/home/dhruvan/yfinance/tests/test_utils.py", line 70, in test_tzCacheRootStore
self.assertTrue(cache.dummy)
AssertionError: False is not true


Ran 109 tests in 308.065s

FAILED (failures=5, errors=1, skipped=2, expected failures=1)

@ericpien
Copy link
Contributor

I ran into this too.

I think the first test_price_repair.TestPriceRepair.test_repair_bad_div_adjusts and test_price_repair.TestPriceRepair.test_repair_zeroes_daily are related to 8daa477 as when I checkout the branch before that, it doesn't report the errors.

As for the test_utils cache test, it's harder to reproduce as it works on individual tests but fails when run under python -m unittest discover -s tests

@ValueRaider
Copy link
Collaborator

ValueRaider commented Nov 14, 2024

If you can just ignore the repair-related tests, fail probably means I improved the algorithm but didn't update the test data.

@ValueRaider
Copy link
Collaborator

There are real bugs in the repair logic, I'll handle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants