/usr/local/lib64/python3.6/site-packages/pandas/tests/util
NameSizeModeActions
__pycache__/-0755rm
conftest.py4760644editdlrm
test_assert_almost_equal.py114990644editdlrm
test_assert_categorical_equal.py27490644editdlrm
test_assert_extension_array_equal.py34710644editdlrm
test_assert_frame_equal.py88350644editdlrm
test_assert_index_equal.py56640644editdlrm
test_assert_interval_array_equal.py23640644editdlrm
test_assert_numpy_array_equal.py63610644editdlrm
test_assert_produces_warning.py5470644editdlrm
test_assert_series_equal.py90890644editdlrm
test_deprecate.py16260644editdlrm
test_deprecate_kwarg.py20430644editdlrm
test_deprecate_nonkeyword_arguments.py27130644editdlrm
test_doc.py14920644editdlrm
test_hashing.py108600644editdlrm
test_numba.py3080644editdlrm
test_safe_import.py10200644editdlrm
test_show_versions.py11870644editdlrm
test_util.py19820644editdlrm
test_validate_args.py18440644editdlrm
test_validate_args_and_kwargs.py23910644editdlrm
test_validate_kwargs.py17400644editdlrm
__init__.py00644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/pandas/tests/util/test_validate_args.py (1844B)
import pytest from pandas.util._validators import validate_args _fname = "func" def test_bad_min_fname_arg_count(): msg = "'max_fname_arg_count' must be non-negative" with pytest.raises(ValueError, match=msg): validate_args(_fname, (None,), -1, "foo") def test_bad_arg_length_max_value_single(): args = (None, None) compat_args = ("foo",) min_fname_arg_count = 0 max_length = len(compat_args) + min_fname_arg_count actual_length = len(args) + min_fname_arg_count msg = ( fr"{_fname}\(\) takes at most {max_length} " fr"argument \({actual_length} given\)" ) with pytest.raises(TypeError, match=msg): validate_args(_fname, args, min_fname_arg_count, compat_args) def test_bad_arg_length_max_value_multiple(): args = (None, None) compat_args = dict(foo=None) min_fname_arg_count = 2 max_length = len(compat_args) + min_fname_arg_count actual_length = len(args) + min_fname_arg_count msg = ( fr"{_fname}\(\) takes at most {max_length} " fr"arguments \({actual_length} given\)" ) with pytest.raises(TypeError, match=msg): validate_args(_fname, args, min_fname_arg_count, compat_args) @pytest.mark.parametrize("i", range(1, 3)) def test_not_all_defaults(i): bad_arg = "foo" msg = ( f"the '{bad_arg}' parameter is not supported " fr"in the pandas implementation of {_fname}\(\)" ) compat_args = {"foo": 2, "bar": -1, "baz": 3} arg_vals = (1, -1, 3) with pytest.raises(ValueError, match=msg): validate_args(_fname, arg_vals[:i], 2, compat_args) def test_validation(): # No exceptions should be raised. validate_args(_fname, (None,), 2, dict(out=None)) compat_args = {"axis": 1, "out": None} validate_args(_fname, (1, None), 2, compat_args)