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

One test fails: tests/test_strategy.py:199: AssertionError #631

Closed
yurivict opened this issue Dec 26, 2022 · 1 comment
Closed

One test fails: tests/test_strategy.py:199: AssertionError #631

yurivict opened this issue Dec 26, 2022 · 1 comment
Labels
bug Something isn't working info Informational

Comments

@yurivict
Copy link

Which version are you running? The lastest version is on Github. Pip is for major releases.
0.3.14

========================================================================================== FAILURES ==========================================================================================
_____________________________________________________________________________ TestStrategyMethods.test_custom_a ______________________________________________________________________________

self = <tests.test_strategy.TestStrategyMethods testMethod=test_custom_a>

    def test_custom_a(self):
        self.category = "Custom E"
    
        amat_logret_ta = [
            {"kind": "amat", "fast": 20, "slow": 50 },  # 2
            {"kind": "log_return", "cumulative": True},  # 1
            {"kind": "ema", "close": "CUMLOGRET_1", "length": 5} # 1
        ]
    
        custom = pandas_ta.Strategy(
            "AMAT Log Returns",  # name
            amat_logret_ta,  # ta
            "AMAT Log Returns",  # description
        )
        self.data.ta.strategy(custom, verbose=verbose, timed=strategy_timed, ordered=True)
        self.data.ta.tsignals(trend=self.data["AMATe_LR_20_50_2"], append=True)
>       self.assertEqual(len(self.data.columns), 13)
E       AssertionError: 101 != 13

tests/test_strategy.py:199: AssertionError
====================================================================================== warnings summary ======================================================================================
pandas_ta/utils/_core.py:14
  /usr/ports/finance/py-pandas-ta/work-py39/pandas-ta-0.3.14/pandas_ta/utils/_core.py:14: DeprecationWarning: invalid escape sequence \g
    return re_.sub("([a-z])([A-Z])","\g<1> \g<2>", x).title()

../../../../../local/lib/python3.9/site-packages/pytest_freezegun.py:17: 706 warnings
  /usr/local/lib/python3.9/site-packages/pytest_freezegun.py:17: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    if LooseVersion(pytest.__version__) < LooseVersion('3.6.0'):

tests/test_ext_indicator_overlap_ext.py::TestOverlapExtension::test_mcgd_ext
tests/test_strategy.py::TestStrategyMethods::test_all_no_multiprocessing
tests/test_indicator_overlap.py::TestOverlap::test_mcgd
  /usr/ports/finance/py-pandas-ta/work-py39/pandas-ta-0.3.14/pandas_ta/overlap/mcgd.py:24: FutureWarning: The series.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
    mcg_ds = close[:1].append(mcg_cell[1:])

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================================== short test summary info ===================================================================================
SKIPPED [1] tests/test_indicator_momentum.py:487: Skipped
SKIPPED [1] tests/test_strategy.py:89: verbose mode only
SKIPPED [1] tests/test_strategy.py:85: verbose mode only
SKIPPED [1] tests/test_utils.py:152: Skipped
SKIPPED [1] tests/test_utils.py:57: Skipped
SKIPPED [1] tests/test_utils.py:156: Skipped
SKIPPED [1] tests/test_utils.py:160: Skipped
SKIPPED [1] tests/test_ext_indicator_momentum.py:231: Skipped
============================================================= 1 failed, 344 passed, 8 skipped, 710 warnings in 143.67s (0:02:23) =============================================================

Python-3.9
FreeBSD 13.1

@yurivict yurivict added the bug Something isn't working label Dec 26, 2022
@twopirllc twopirllc removed their assignment Jan 7, 2023
@twopirllc twopirllc added help wanted Extra attention is needed good first issue Good for newcomers info Informational and removed help wanted Extra attention is needed good first issue Good for newcomers labels Jan 7, 2023
@twopirllc
Copy link
Owner

Hello @yurivict,

Interesting. 🤔 It appears the prior test did not properly reset the columns before testing this strategy. Does the

Due to numerous bugs, additional features, documentation and speed improvements, v0.3.14 is not supported. All improvements are on the development version. Does this also occur on FreeBSD with the development version?

Kind Regards,
KJ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working info Informational
Projects
None yet
Development

No branches or pull requests

2 participants