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 Pytest for running tests #726

Merged
merged 11 commits into from Jun 21, 2023
Merged

Conversation

peanutfun
Copy link
Member

@peanutfun peanutfun commented May 17, 2023

Changes proposed in this PR:

  • Switch to pytest for executing tests. This relieves us from relying on XMLRunner and the testing scripts when executing unit and integration tests. (XMLRunner cannot be removed from the dependencies yet because it is used in the scripts for testing the notebooks and data API).
  • Mention that make is needed to run the tests exactly as they are in the CI pipeline.

NOTE: After review, please remove the line installing the new test dependencies and add these to the Jenkins test environment instead: https://github.com/CLIMADA-project/climada_python/pull/726/files#diff-efc5a58368476423c7df00e553fe2c5ba301550f96c3cc5a970aa9a51c9e4eddR26

PR Author Checklist

PR Reviewer Checklist

@peanutfun peanutfun marked this pull request as ready for review May 30, 2023 12:02
@peanutfun peanutfun requested a review from chahank June 12, 2023 12:04

.PHONY : install_test
install_test : ## Test installation was successful
python tests_install.py report
pytest $(PYTEST_JUNIT_ARGS) climada/engine/test/test_cost_benefit.py \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for the future: we should probably make a better install test. If there is already one around, I would propose to switch now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a particular integration test in mind that would be suitable for that?

@chahank
Copy link
Member

chahank commented Jun 13, 2023

Looks all very reasonable and useful. However, I cannot gauge the code on a technical level. @emanuel-schmid : could you please have a look and confirm the review?

Copy link
Collaborator

@emanuel-schmid emanuel-schmid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 looks good to me

doc/guide/install.rst Outdated Show resolved Hide resolved
@emanuel-schmid emanuel-schmid merged commit 0f904d2 into develop Jun 21, 2023
4 checks passed
@emanuel-schmid
Copy link
Collaborator

🙌

@emanuel-schmid emanuel-schmid deleted the pytest-for-running-tests branch June 21, 2023 14:05
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.

None yet

3 participants