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

Use data path and fixtures consistently #58

Merged
merged 4 commits into from
Mar 21, 2024
Merged

Use data path and fixtures consistently #58

merged 4 commits into from
Mar 21, 2024

Conversation

K-Meech
Copy link
Contributor

@K-Meech K-Meech commented Mar 20, 2024

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?
Currently tests don't access the test data directory in a consistent way. For example, many use os.path.join("tests", "data") which means pytest fails when run from any location apart from the top directory.

Also, fixtures aren't consistently used for data generated inside of test modules.

What does this PR do?

This PR creates a data_path fixture inside of tests/tests/conftest.py that can be re-used by all tests. This ensures pytest can be run from any location successfully.

The PR also makes sure that any data generated inside of tests is wrapped into a fixture.

References

None

How has this PR been tested?

All tests pass locally.

Is this a breaking change?

No

Does this PR require an update to the documentation?

No

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality (unit & integration)
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

@K-Meech K-Meech requested a review from a team March 20, 2024 15:19
Copy link

codecov bot commented Mar 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.07%. Comparing base (87ca009) to head (830c1d2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #58   +/-   ##
=======================================
  Coverage   84.07%   84.07%           
=======================================
  Files          35       35           
  Lines        1331     1331           
=======================================
  Hits         1119     1119           
  Misses        212      212           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

tests/tests/test_IO/test_cell_io.py Show resolved Hide resolved
tests/tests/test_IO/test_cell_io.py Outdated Show resolved Hide resolved
tests/tests/test_general/test_list.py Outdated Show resolved Hide resolved
tests/tests/test_general/test_list.py Show resolved Hide resolved
@K-Meech
Copy link
Contributor Author

K-Meech commented Mar 21, 2024

Ok - all fixed now! Data has been moved to the data folder, + some fixtures changed to parametrize, + I noticed I'd missed the test_pandas/test_pandas_misc file so I updated that to match the rest. @willGraham01 - could you maybe take a quick look, then merge if you're happy with it? Thanks!

@willGraham01 willGraham01 merged commit 264f849 into main Mar 21, 2024
12 checks passed
@willGraham01 willGraham01 deleted the data_paths branch March 21, 2024 15:36
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

Successfully merging this pull request may close these issues.

3 participants