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

openbb_terminal tests: coverage (61% -> 65%) #1664

Merged
merged 29 commits into from
Apr 20, 2022
Merged

openbb_terminal tests: coverage (61% -> 65%) #1664

merged 29 commits into from
Apr 20, 2022

Conversation

colin99d
Copy link
Contributor

@colin99d colin99d commented Apr 9, 2022

Description

Expanding general terminal tests. Will plan on being ready to merge on Sunday night regardless of how many tests have been written: Adding tests to:

  • Keys Controller
  • Econometrics Controller
  • Settings Controller
  • common/qa_view

@JerBouma I also added some enhancements to the econometrics controller to make it more robust. Can you please confirm these changes are desired?

@Chavithra the tests pass now. I BELIEVE matplotlib.pyplot.show is now fully mocked.

Also, Fixes #1667

How has this been tested?

Ran pytest.

Checklist:

Others

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My code passes all the checks pylint, flake8, black, ... To speed up development you should run pre-commit install.
  • New and existing unit tests pass locally with my changes. You can test this locally using pytest tests/....

@colin99d colin99d added the tests Test-related work label Apr 9, 2022
@colin99d colin99d requested a review from Chavithra April 9, 2022 17:34
@colin99d colin99d requested a review from JerBouma April 9, 2022 18:10
@colin99d
Copy link
Contributor Author

@Chavithra I cannot figure out how to mock matplotlib so that it will not show graphs in tests/openbb_terminal/common/quantitative_analysis/test_qa_view.py. Any advice?

@JerBouma
Copy link
Contributor

@colin99d Looks good to me! 👍

@colin99d colin99d changed the title Terminal Tests openbb_terminal tests: coverage (61% -> 65%) Apr 12, 2022
Copy link
Contributor

@Chavithra Chavithra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an issue on my Windows :

>           path_cmd = dir_path.split("openbb_terminal/")[1].replace("/", "_")
E           IndexError: list index out of range

Maybe that's related to the OS separator.


========================================================================================================================== short test summary info ========================================================================================================================== 
FAILED tests/openbb_terminal/common/quantitative_analysis/test_qa_view.py::test_display_summary - IndexError: list index out of range
FAILED tests/openbb_terminal/common/quantitative_analysis/test_qa_view.py::test_display_cdf[None] - IndexError: list index out of range
FAILED tests/openbb_terminal/common/quantitative_analysis/test_qa_view.py::test_display_seasonal[False] - IndexError: list index out of range
FAILED tests/openbb_terminal/common/quantitative_analysis/test_qa_view.py::test_display_seasonal[True] - IndexError: list index out of range
FAILED tests/openbb_terminal/common/quantitative_analysis/test_qa_view.py::test_display_normality - IndexError: list index out of range
======================================================================================================================= 5 failed, 23 passed in 5.71s ========================================================================================================================

@@ -0,0 +1,4 @@

The following args couldn't be interpreted: ['-n', 'dataset']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an issue there ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Chavithra can you try with my changes and let me know if that resolves it.. haha get it? I'll walk myself out...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Chavithra this is not an issue.

colin99d and others added 3 commits April 12, 2022 13:55
Fix any windows path issues
oops forgot import lol
@colin99d colin99d merged commit 8994168 into main Apr 20, 2022
@colin99d colin99d deleted the termtests branch April 20, 2022 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Test-related work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Econometrics Export FileNotFound
4 participants