Skip to content

Commit

Permalink
Avoid warnings in tests (omry#710)
Browse files Browse the repository at this point in the history
  • Loading branch information
odelalleau authored May 7, 2021
1 parent e4681ef commit 8cf4a3d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/test_omegaconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,12 @@ def test_is_optional_deprecation() -> None:

def test_coverage_for_deprecated_OmegaConf_is_optional() -> None:
cfg = OmegaConf.create({"node": 123})
assert OmegaConf.is_optional(cfg)
assert OmegaConf.is_optional(cfg, "node")
assert OmegaConf.is_optional("not_a_node")
with warns(UserWarning):
assert OmegaConf.is_optional(cfg)
with warns(UserWarning):
assert OmegaConf.is_optional(cfg, "node")
with warns(UserWarning):
assert OmegaConf.is_optional("not_a_node")


@mark.parametrize("is_none", [True, False])
Expand Down

0 comments on commit 8cf4a3d

Please sign in to comment.