8000 Test deprecated access to have full coverage again · graphql-python/graphql-relay-py@e41ac17 · GitHub
[go: up one dir, main page]

Skip to content

Commit e41ac17

Browse files
committed
Test deprecated access to have full coverage again
1 parent f97a3ce commit e41ac17

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/connection/test_array_connection.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@
3232

3333

3434
def describe_connection_from_array():
35+
def warns_for_deprecated_import():
36+
from importlib import reload
37+
38+
with deprecated_call():
39+
from graphql_relay.connection import arrayconnection as deprecated
40+
41+
# noinspection PyDeprecation
42+
reload(deprecated)
43+
# noinspection PyDeprecation
44+
assert deprecated.connection_from_array is connection_from_array
45+
3546
def describe_basic_slicing():
3647
def returns_all_elements_without_filters():
3748
c = connection_from_array(array_abcde, {})
@@ -465,6 +476,17 @@ def provides_deprecated_connection_from_list():
465476

466477

467478
def describe_connection_from_array_slice():
479+
def warns_for_deprecated_import():
480+
from importlib import reload
481+
482+
with deprecated_call():
483+
from graphql_relay.connection import arrayconnection as deprecated
484+
485+
# noinspection PyDeprecation
486+
reload(deprecated)
487+
# noinspection PyDeprecation
488+
assert deprecated.connection_from_array_slice is connection_from_array_slice
489+
468490
def works_with_a_just_right_array_slice():
469491
c = connection_from_array_slice(
470492
array_abcde[1:3],

0 commit comments

Comments
 (0)
0