Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .cspell.dict/cpython.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ badcert
badsyntax
baseinfo
basetype
binop
boolop
BUILDSTDLIB
bxor
Expand Down Expand Up @@ -73,6 +74,7 @@ HASPOINTER
HASSTRUCT
HASUNION
heaptype
hexdigit
HIGHRES
IFUNC
IMMUTABLETYPE
Expand Down
214 changes: 214 additions & 0 deletions Lib/test/test_ast/data/ast_repr.txt

Large diffs are not rendered by default.

65 changes: 0 additions & 65 deletions Lib/test/test_ast/test_ast.py

Large diffs are not rendered by default.

21 changes: 4 additions & 17 deletions Lib/test/test_builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,6 @@ def f(): """doc"""
rv = ns['f']()
self.assertEqual(rv, tuple(expected))

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_compile_top_level_await_no_coro(self):
"""Make sure top level non-await codes get the correct coroutine flags"""
modes = ('single', 'exec')
Expand Down Expand Up @@ -552,7 +551,6 @@ async def sleep(delay, result=None):
run_yielding_async_fn(lambda: eval(co, globals_))
self.assertEqual(globals_['a'], 1)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_compile_top_level_await_invalid_cases(self):
# helper function just to check we can run top=level async-for
async def arange(n):
Expand Down Expand Up @@ -593,7 +591,6 @@ async def __aexit__(self, *exc_info):
mode,
flags=ast.PyCF_ALLOW_TOP_LEVEL_AWAIT)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_compile_async_generator(self):
"""
With the PyCF_ALLOW_TOP_LEVEL_AWAIT flag added in 3.8, we want to
Expand Down Expand Up @@ -640,7 +637,7 @@ def test_delattr(self):
msg = r"^attribute name must be string, not 'int'$"
self.assertRaisesRegex(TypeError, msg, delattr, sys, 1)

@unittest.expectedFailure # TODO: RUSTPYTHON
@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: '__repr__' unexpectedly found in ['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__firstlineno__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__slots__', '__str__', '__subclasshook__', 'bar']
def test_dir(self):
# dir(wrong number of arguments)
self.assertRaises(TypeError, dir, 42, 42)
Expand Down Expand Up @@ -894,7 +891,6 @@ def test_exec_kwargs(self):
exec('global z\nz = 1', locals=g)
self.assertEqual(g, {})

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_exec_globals(self):
code = compile("print('Hello World!')", "", "exec")
# no builtin function
Expand All @@ -904,7 +900,6 @@ def test_exec_globals(self):
self.assertRaises(TypeError,
exec, code, {'__builtins__': 123})

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_exec_globals_frozen(self):
class frozendict_error(Exception):
pass
Expand Down Expand Up @@ -937,7 +932,6 @@ def __setitem__(self, key, value):
self.assertRaises(frozendict_error,
exec, code, namespace)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_exec_globals_error_on_get(self):
# custom `globals` or `builtins` can raise errors on item access
class setonlyerror(Exception):
Expand All @@ -957,7 +951,6 @@ def __getitem__(self, key):
self.assertRaises(setonlyerror, exec, code,
{'__builtins__': setonlydict({'superglobal': 1})})

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_exec_globals_dict_subclass(self):
class customdict(dict): # this one should not do anything fancy
pass
Expand All @@ -969,7 +962,6 @@ class customdict(dict): # this one should not do anything fancy
self.assertRaisesRegex(NameError, "name 'superglobal' is not defined",
exec, code, {'__builtins__': customdict()})

@unittest.expectedFailure # TODO: RUSTPYTHON; NameError: name 'superglobal' is not defined
def test_eval_builtins_mapping(self):
code = compile("superglobal", "test", "eval")
# works correctly
Expand Down Expand Up @@ -1009,7 +1001,7 @@ def test_exec_redirected(self):
finally:
sys.stdout = savestdout

@unittest.expectedFailure # TODO: RUSTPYTHON
@unittest.expectedFailure # TODO: RUSTPYTHON; TypeError: Unexpected keyword argument closure
def test_exec_closure(self):
def function_without_closures():
return 3 * 5
Expand Down Expand Up @@ -1680,7 +1672,6 @@ def test_open(self):
self.assertRaises(ValueError, open, 'a\x00b')
self.assertRaises(ValueError, open, b'a\x00b')

@unittest.expectedFailure # TODO: RUSTPYTHON
@unittest.skipIf(sys.flags.utf8_mode, "utf-8 mode is enabled")
def test_open_default_encoding(self):
with EnvironmentVarGuard() as env:
Expand Down Expand Up @@ -2715,7 +2706,6 @@ def detach_readline(self):
else:
yield

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_input_tty(self):
# Test input() functionality when wired to a tty
self.check_input_tty("prompt", b"quux")
Expand All @@ -2730,20 +2720,17 @@ def test_input_tty_non_ascii_unicode_errors(self):
# Check stdin/stdout error handler is used when invoking PyOS_Readline()
self.check_input_tty("prompté", b"quux\xe9", "ascii")

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_input_tty_null_in_prompt(self):
self.check_input_tty("prompt\0", b"",
expected='ValueError: input: prompt string cannot contain '
'null characters')

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_input_tty_nonencodable_prompt(self):
self.check_input_tty("prompté", b"quux", "ascii", stdout_errors='strict',
expected="UnicodeEncodeError: 'ascii' codec can't encode "
"character '\\xe9' in position 6: ordinal not in "
"range(128)")

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_input_tty_nondecodable_input(self):
self.check_input_tty("prompt", b"quux\xe9", "ascii", stdin_errors='strict',
expected="UnicodeDecodeError: 'ascii' codec can't decode "
Expand Down Expand Up @@ -2960,7 +2947,7 @@ def test_type_qualname(self):
A.__qualname__ = b'B'
self.assertEqual(A.__qualname__, 'D.E')

@unittest.expectedFailure # TODO: RUSTPYTHON
@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: '__firstlineno__' unexpectedly found in mappingproxy({'__firstlineno__': 42, '__module__': 'testmodule', '__dict__': <attribute '__dict__' of 'A' objects>, '__doc__': None})
def test_type_firstlineno(self):
A = type('A', (), {'__firstlineno__': 42})
self.assertEqual(A.__name__, 'A')
Expand All @@ -2972,7 +2959,7 @@ def test_type_firstlineno(self):
A.__firstlineno__ = 43
self.assertEqual(A.__dict__['__firstlineno__'], 43)

@unittest.expectedFailure # TODO: RUSTPYTHON
@unittest.expectedFailure # TODO: RUSTPYTHON; TypeError: Expected type 'tuple' but 'str' found.
def test_type_typeparams(self):
class A[T]:
pass
Expand Down
2 changes: 0 additions & 2 deletions Lib/test/test_funcattrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ def test___globals__(self):
self.cannot_set_attr(self.b, '__globals__', 2,
(AttributeError, TypeError))

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test___builtins__(self):
self.assertIs(self.b.__builtins__, __builtins__)
self.cannot_set_attr(self.b, '__builtins__', 2,
Expand Down
Loading
Loading