From b5bd8496b02c52c50286f8f96ee1c53deb822b5a Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Mon, 18 Jul 2016 19:28:01 +0200 Subject: [PATCH] Fix the errors for the old octal tests. --- test/test_api/test_api.py | 1 - test/test_parser/test_pgen2.py | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test/test_api/test_api.py b/test/test_api/test_api.py index 513f4d92..fc961872 100644 --- a/test/test_api/test_api.py +++ b/test/test_api/test_api.py @@ -85,7 +85,6 @@ def test_completion_on_hex_literals(): # (invalid statements). assert api.Script('0b2.').completions() == [] _check_number('0b1.', 'int') # binary - _check_number('0o7.', 'int') # octal _check_number('0x2e.', 'int') _check_number('0xE7.', 'int') diff --git a/test/test_parser/test_pgen2.py b/test/test_parser/test_pgen2.py index e7b4473b..46f4938f 100644 --- a/test/test_parser/test_pgen2.py +++ b/test/test_parser/test_pgen2.py @@ -9,7 +9,7 @@ test_grammar.py files from both Python 2 and Python 3. from textwrap import dedent -from jedi._compatibility import unicode +from jedi._compatibility import unicode, is_py3 from jedi.parser import Parser, load_grammar, ParseError import pytest @@ -216,7 +216,11 @@ class TestSetLiteral(GrammarTest): class TestNumericLiterals(GrammarTest): def test_new_octal_notation(self): - parse("""0o7777777777777""") + code = """0o7777777777777""" + if is_py3: + parse(code) + else: + self.invalid_syntax(code) self.invalid_syntax("""0o7324528887""") def test_new_binary_notation(self):