def test_fail__valid_port(arg: Any) -> None: with pytest.raises(ValidatorError): print(valid_port(arg))
def test_ok__valid_port(arg: Any) -> None: value = valid_port(arg) assert type(value) == int # pylint: disable=unidiomatic-typecheck assert value == int(str(arg).strip())