diff options
author | Damien George <damien.p.george@gmail.com> | 2015-10-02 13:01:47 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-10-02 13:01:47 +0100 |
commit | 34f26ea862d18c61a66f36f44277bb954bf36cd1 (patch) | |
tree | 12b20d3fd619dfb564ee5f1c347e30a646ea4e1a /tests/basics/python34.py | |
parent | 9e0a3d46b6eb176a3450d565c9e172eb22f9c8dc (diff) |
tests: Allow tests to pass against CPython 3.5.
All breaking changes going from 3.4 to 3.5 are contained in
basics/python34.py.
Diffstat (limited to 'tests/basics/python34.py')
-rw-r--r-- | tests/basics/python34.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/basics/python34.py b/tests/basics/python34.py new file mode 100644 index 000000000..2e9d468b2 --- /dev/null +++ b/tests/basics/python34.py @@ -0,0 +1,26 @@ +# tests that differ when running under Python 3.4 vs 3.5 + +# from basics/fun_kwvarargs.py +# test evaluation order of arguments (in 3.4 it's backwards, 3.5 it's fixed) +def f4(*vargs, **kwargs): + print(vargs, kwargs) +def print_ret(x): + print(x) + return x +f4(*print_ret(['a', 'b']), kw_arg=print_ret(None)) + +# from basics/syntaxerror.py +# can't have multiple * or ** (in 3.5 we can) +def test_syntax(code): + try: + exec(code) + except SyntaxError: + print("SyntaxError") +test_syntax("f(*a, *b)") +test_syntax("f(**a, **b)") + +# from basics/sys1.py +# uPy prints version 3.4 +import sys +print(sys.version[:3]) +print(sys.version_info[0], sys.version_info[1]) |