Skip to content

[ENH] Add metadata pytest fixtures to reduce code duplication in tests #1858

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

Open
PranavBhatP opened this issue May 29, 2025 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@PranavBhatP
Copy link
Contributor

PranavBhatP commented May 29, 2025

Is your feature request related to a problem? Please describe.
The metadata property is being frequently accessed across multiple test functions in test_data_module.py.

Suggested fixes
Creating pytest fixtures for metadata would eliminate the repeated need for calling

metadata = data_module.time_series_metadata

and then individually accessing the metadata, rather we could unfold the metadata within this fixture and reuse it. This was just an observation and would be a good fix early on to ensure similar practice in future tests.

@PranavBhatP
Copy link
Contributor Author

PranavBhatP commented May 29, 2025

FYI @phoeenniixx. I'm trying to implement similar changes for the tslib d2 module tests. You can open a PR for this, if you wish, since these will be non-breaking changes.

@fkiraly fkiraly added the enhancement New feature or request label May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants