Skip to content

Commit

Permalink
Add test for arg handling
Browse files Browse the repository at this point in the history
Test dewpoint_from_specific_humidity handling with 1 arg, 1 kwarg.
  • Loading branch information
dcamron committed Nov 1, 2023
1 parent a418f4d commit e6239e9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/calc/test_thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1829,7 +1829,7 @@ def test_dewpoint_specific_humidity_kwargs():
assert_almost_equal(td, 17.036 * units.degC, 3)


def test_dewpoint_specific_humidity_mixed_args_kwargs():
def test_dewpoint_specific_humidity_three_mixed_args_kwargs():
"""Test mixed arg, kwarg handling for backwards compatibility MetPy>=1.6."""
p = 1013.25 * units.mbar
temperature = 20. * units.degC
Expand All @@ -1840,6 +1840,15 @@ def test_dewpoint_specific_humidity_mixed_args_kwargs():
assert_almost_equal(td, 17.036 * units.degC, 3)


def test_dewpoint_specific_humidity_two_mixed_args_kwargs():
"""Test function's internal arg, kwarg processing handles mixed case."""
p = 1013.25 * units.mbar
q = 0.012 * units.dimensionless
td = dewpoint_from_specific_humidity(
p, specific_humidity=q)
assert_almost_equal(td, 17.036 * units.degC, 3)


def test_dewpoint_specific_humidity_two_args():
"""Test new signature, Temperature unneeded, MetPy>=1.6."""
p = 1013.25 * units.mbar
Expand Down

0 comments on commit e6239e9

Please sign in to comment.