Skip to content

Commit

Permalink
Adjust for change to documention change of next in Python 3.12
Browse files Browse the repository at this point in the history
The signature of the builtin isn't actually changing in Python 3.12,
however its documentation has changed.
  • Loading branch information
PeterJCLaw committed Sep 17, 2023
1 parent 770cdad commit a60fdba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion test/test_inference/test_compiled.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from textwrap import dedent
import sys
import math
from collections import Counter
from datetime import datetime
Expand Down Expand Up @@ -26,7 +27,10 @@ def test_builtin_loading(inference_state):
assert not from_name.py__doc__() # It's a stub


def test_next_docstr(inference_state):
def test_next_docstr(inference_state, environment):
if environment.version_info[:2] != sys.version_info[:2]:
pytest.skip()

next_ = compiled.builtin_from_name(inference_state, 'next')
assert next_.tree_node is not None
assert next_.py__doc__() == '' # It's a stub
Expand Down
3 changes: 2 additions & 1 deletion test/test_inference/test_signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
'code, sig, names, op, version', [
('import math; math.cos', 'cos(x, /)', ['x'], ge, (3, 6)),
('next', 'next(iterator, default=None, /)', ['iterator', 'default'], ge, (3, 6)),
('next', 'next(iterator, default=None, /)', ['iterator', 'default'], lt, (3, 12)),
('next', 'next()', [], ge, (3, 12)),
('str', "str(object='', /) -> str", ['object'], ge, (3, 6)),
Expand Down

0 comments on commit a60fdba

Please sign in to comment.