-
Notifications
You must be signed in to change notification settings - Fork 4
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
Feature/test examples #284
Conversation
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.
Thank you @MaGering for adding these tests!
As you have said yourself there are comments that need adaption.
Where do you actually run the test? Does if os.system("python " + self.elec_sector_path) == 0:
run the python file?
tests/test_examples.py
Outdated
self.outputs_directory, scenario_name + "_test_run_through", | ||
) | ||
if os.path.exists(dir_name): | ||
shutil.rmtree(dir_name, ignore_errors=True) |
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.
This part (deleting files) could be a teardown method or teardown class to avoid doubling.
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.
Done with commit 68b087b.
Co-authored-by: Sabine Haas <[email protected]>
…ect/pvcompare into feature/test_examples
Yes exactly, it executes the script and returns the exit code in 16 bits code. I explained this (with recent commit 3cee624) in a comment in the lines above |
@SabineHaas do you know why the Read the Docs build fails? :-/ |
Seems like there's a problem with the installation of |
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.
Could you add an assertion statement behind the assertion e.g.
`, f"The example 'xy' exited with exit code {exit_code}." ?
Then everything looks good from my point of view.
Co-authored-by: Sabine Haas <[email protected]>
Good point! Done with commit 5952083. |
Fix Issue #228
With this PR tests are added which check if the examples in pvcompare run.
Running with
exit code == 0
leads to:The following steps were realized, as well (required):
EXECUTE_TESTS_ON=master pytest
)Also the following steps were realized (if applies):
Please mark above checkboxes as following:
In case of an error due to linting, run
black . --exclude docs/
and push your changes.Note that in case you do not fix a whole issue you should start your PR with
Address #xyz
.For more information on how to contribute check the CONTRIBUTING.md.