Skip to content

Commit 6cd0c14

Browse files
authored
Show what parameter/attribute is missing in test_offical (python-telegram-bot#808)
* Show what parameter/attribute is missing in test_offical * Only run test_official on py3.6 Down from 3.5 and 3.6
1 parent b6a0853 commit 6cd0c14

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/test_official.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ def check_method(h4):
6565
checked = []
6666
for parameter in table:
6767
param = sig.parameters.get(parameter.Parameters)
68-
assert param is not None
68+
assert param is not None, "Parameter {} not found in {}".format(parameter.Parameters,
69+
method.__name__)
6970
# TODO: Check type via docstring
7071
# TODO: Check if optional or required
7172
checked.append(parameter.Parameters)
@@ -106,7 +107,7 @@ def check_object(h4):
106107
continue
107108

108109
param = sig.parameters.get(field)
109-
assert param is not None
110+
assert param is not None, "Attribute {} not found in {}".format(field, obj.__name__)
110111
# TODO: Check type via docstring
111112
# TODO: Check if optional or required
112113
checked.append(field)
@@ -149,7 +150,7 @@ def check_object(h4):
149150

150151

151152
@pytest.mark.parametrize(('method', 'data'), argvalues=argvalues, ids=names)
152-
@pytest.mark.skipif(not sys.version_info >= (3, 5) or python_implementation() != 'CPython',
153+
@pytest.mark.skipif(not sys.version_info >= (3, 6) or python_implementation() != 'CPython',
153154
reason='follow_wrapped (inspect.signature) is not supported on this platform')
154155
def test_official(method, data):
155156
method(data)

0 commit comments

Comments
 (0)