-
Notifications
You must be signed in to change notification settings - Fork 115
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
Test using in-memory databases and other clean-ups #270
Conversation
- This avoids using has_solution() on TimeSeries.
- Since a common pint registry is used for all code/tests, this test can fail depending on whether it is run in isolation or as part of the entire suite. Relax one log assertion to avoid these failures.
Codecov Report
@@ Coverage Diff @@
## master #270 +/- ##
=======================================
Coverage 96.96% 96.96%
=======================================
Files 38 38
Lines 3530 3530
=======================================
Hits 3423 3423
Misses 107 107 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record, the file to create the testdb existed at least until v0.1.3 - tests/testdb_setup.py. But using an in-memory db is of course smarter.
Apart from that, I don't think that I can provide any useful review comments to that PR...
This PR improves the test suite in a variety of ways:
ixmp.testing.populate_test_platform()
is added, which fills any Platform with equivalent content.test_mp
fixture now refers to a temporary, in-memory database.test_mp
andpopulate_test_platform()
to generate the equivalent of the old testdb. Other tests, where possible, use a completely emptytest_mp
.ixmp.core
are split into three files, one for each of the Platform, TimeSeries, and Scenario classes.tmpdir
pytest fixture is replaced with the currenttmp_path
.TimeSeries.get_geodata()
returns the 'year' and 'meta' columns as int, to be consistent with other code.Scenario.check_out()
checks if the Scenario has a solution, butTimeSeries.check_out()
does not, because this is meaningless.How to review
Confirm that CI checks pass.
PR checklist