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

Test interp nominal lon #365

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

JoranAngevaare
Copy link
Contributor

Fix test for _interp_nominal_lon

This PR is some leftover work from #296 (and #300)

PR checks

Copy link
Owner

@jbusecke jbusecke left a comment

Choose a reason for hiding this comment

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

Thanks for putting in more work into polishing this up @JoranAngevaare! I would much prefer to keep this in pure pytest, but I might also be missing something here.

@@ -191,6 +193,57 @@ def test_replace_x_y_nominal_lat_lon(dask, nans):
assert set(replaced_ds.lat.dims) == set(["x", "y"])


class TestReplaceXYNominalLatLon(TestCase):
Copy link
Owner

Choose a reason for hiding this comment

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

I am not really familiar with unittest. Is there a specific reason not to use pytest fixtures (or plain functions) in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unittest comes with a few handy tools. I personally like it a lot because plain functions - in my experience - sometimes increase code duplication and add clutter for setting up some dummy data. Truthfully, I only use TestCase.assertRaises and TestCase.assertTrue which I can easily replace with some plain code, and this specific test is really simple to do without things from Unittest. I'll change it.

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.

Adding new contributors to CITATION.cff replace_x_y_nominal_lat_lon does not work for > 360 lon coordinates
2 participants