diff options
author | Seth Morton <seth.m.morton@gmail.com> | 2019-02-04 21:35:56 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-04 21:35:56 -0800 |
commit | becffefb6da656fa665f077f3fe692c7e3fa2afe (patch) | |
tree | f53ef5c1a66c345f53aec0658e083ce662ce5185 /tests | |
parent | bf2251211cd8dee91f669693e2ca0eb39a3daa2b (diff) | |
parent | aa36e5c085a0c9fab4c8ee0d181efc2d0e7b76a6 (diff) | |
download | natsort-becffefb6da656fa665f077f3fe692c7e3fa2afe.tar.gz |
Merge pull request #81 from SethMMorton/remove-deprecated-apis
Remove Deprecated APIs
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_natsorted_convenience.py | 14 | ||||
-rw-r--r-- | tests/test_utils.py | 30 |
2 files changed, 0 insertions, 44 deletions
diff --git a/tests/test_natsorted_convenience.py b/tests/test_natsorted_convenience.py index 3c26be0..876a4e7 100644 --- a/tests/test_natsorted_convenience.py +++ b/tests/test_natsorted_convenience.py @@ -16,12 +16,10 @@ from natsort import ( index_humansorted, index_natsorted, index_realsorted, - index_versorted, natsorted, ns, order_by_index, realsorted, - versorted, ) from natsort.compat.py23 import PY_VERSION @@ -66,12 +64,6 @@ def test_as_utf8_converts_bytes_to_utf8(): assert decoder("utf8")(b"bytes") == as_utf8(b"bytes") -def test_versorted_is_identical_to_natsorted(version_list): - # versorted is retained for backwards compatibility - with pytest.warns(DeprecationWarning, match="use natsorted instead"): - assert versorted(version_list) == natsorted(version_list) - - def test_realsorted_is_identical_to_natsorted_with_real_alg(float_list): assert realsorted(float_list) == natsorted(float_list, alg=ns.REAL) @@ -101,12 +93,6 @@ def test_index_natsorted_applies_key_function_before_sorting(): assert index_natsorted(given, key=itemgetter(1)) == expected -def test_index_versorted_is_identical_to_index_natsorted(version_list): - # index_versorted is retained for backwards compatibility - with pytest.warns(DeprecationWarning, match="use index_natsorted instead"): - assert index_versorted(version_list) == index_natsorted(version_list) - - def test_index_realsorted_is_identical_to_index_natsorted_with_real_alg(float_list): assert index_realsorted(float_list) == index_natsorted(float_list, alg=ns.REAL) diff --git a/tests/test_utils.py b/tests/test_utils.py index 0413d48..5cd469a 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -21,30 +21,6 @@ def test_do_decoding_decodes_bytes_string_to_unicode(): assert utils.do_decoding(b"bytes", "ascii") == b"bytes".decode("ascii") -def test_args_to_enum_raises_typeerror_for_invalid_argument(): - with pytest.raises(TypeError): - utils.args_to_enum(**{"alf": 0}) - - -@pytest.mark.parametrize( - "kwargs, expected", - [ - ({"number_type": float, "signed": True, "exp": True}, ns.F | ns.S), - ({"number_type": float, "signed": True, "exp": False}, ns.F | ns.N | ns.S), - ({"number_type": float, "signed": False, "exp": True}, ns.F | ns.U), - ({"number_type": float, "signed": False, "exp": True}, ns.F), - ({"number_type": float, "signed": False, "exp": False}, ns.F | ns.U | ns.N), - ({"number_type": float, "as_path": True}, ns.F | ns.P), - ({"number_type": int, "as_path": True}, ns.I | ns.P), - ({"number_type": int, "signed": False}, ns.I | ns.U), - ({"number_type": None, "exp": True}, ns.I | ns.U), - ], -) -def test_args_to_enum(kwargs, expected): - with pytest.warns(DeprecationWarning): - assert utils.args_to_enum(**kwargs) == expected - - @pytest.mark.parametrize( "alg, expected", [ @@ -97,12 +73,6 @@ def test_ns_enum_values_and_aliases(alg, value_or_alias): assert alg == value_or_alias -@pytest.mark.parametrize("alg", ["V", "VERSION", "T", "TYPESAFE", "D", "DIGIT"]) -def test_deprecated_ns_enum_values_and_aliases_produce_warning(alg): - with pytest.warns(DeprecationWarning, match="please simply remove"): - assert getattr(ns, alg) == 0 - - def test_chain_functions_is_a_no_op_if_no_functions_are_given(): x = 2345 assert utils.chain_functions([])(x) is x |