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

plotting unit tests #121

Closed
jrob93 opened this issue May 14, 2024 · 0 comments · Fixed by #182
Closed

plotting unit tests #121

jrob93 opened this issue May 14, 2024 · 0 comments · Fixed by #182
Assignees

Comments

@jrob93
Copy link
Collaborator

jrob93 commented May 14, 2024

Following PR #114 the plotting functions need unit tests. @astronomerritt's suggestions:

  • Run the function several times testing each if-statement (so one that uses label_list, one that uses col_list, one accepting fig as an argument). You don't have to check the resultant plots - the aim of the unit test is to make sure that no errors trigger when the function is called. That way, if anything changes in the code that would break plotting entirely, we'll know.
  • Create a plot using savefig then check that it exists where you told it to save using os.path.exists(). Using pytest's tmp_path functionality is helpful here to direct output of tests to a temporary location. You can see how that's done in test_AdlerData.py in the test test_write_row_to_database().
@jrob93 jrob93 self-assigned this May 14, 2024
@jrob93 jrob93 mentioned this issue Nov 19, 2024
5 tasks
@jrob93 jrob93 linked a pull request Nov 19, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant