Translate API request tests to pytest#584
Open
YulianLC wants to merge 1 commit intoos-climate:mainfrom
Open
Conversation
-Add live_data pytest marker -Add clear_credentials fixture to conftest -Improve live_data marker validation and environment matching -Move test_example_portfolios from kernel tests to api tests Co-authored-by: Arfima Dev <dev@arfima.com> Signed-off-by: Yulian Lyubomirov Cenov <ycenov@arfima.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request migrates the API request tests (
test_data_request.pyandtest_impact_request.py) from unittest to pytest.It also moves
test_example_portfoliosfromtest_live_services.pyintotest_impact_request.py, where it fits better because it exercises the API request/response path rather than isolated kernel logic.It adds
test_available_sourcesto cover theget_available_sourcesendpoint.conftest.pyis updated to support this migration by addingclear_credentialsfixture for tests that should use the public OSC bucket anonymously, and by improvinglive_datamarker handling so live tests are skipped unlessPHYSRISK_ENVIRONMENTmatches the requested environment.For now, this PR only covers the API request tests as a focused example of how we plan to migrate the test suite from unittest to pytest. A follow-up PR will extend this approach to the remaining tests.
Co-authored-by: Juan Román Roche jroman@arfimaconsulting.com
Co-authored-by: Martxel Aranzadi Olazabal maranzadi@arfima.com
Co-authored-by: Violeta Crespo Cobas vcrespo@arfima.com
Co-authored-by: Jonathan Yanez Vargas jyanez@arfima.com
Co-authored-by: Arfima Dev dev@arfima.com
Co-authored-by: Virginia Morales vmorales@arfima.com
Co-authored-by: Víctor de Luna vdeluna@arfima.com
Co-authored-by: Xavier Barrachina Civera xbarrachina@arfima.com
Signed-off-by: Yulian Lyubomirov Cenov ycenov@arfima.com