Fix the errors for the old octal tests.

This commit is contained in:
Dave Halter
2016-07-18 19:28:01 +02:00
parent 2776af3db5
commit b5bd8496b0
2 changed files with 6 additions and 3 deletions

View File

@@ -85,7 +85,6 @@ def test_completion_on_hex_literals():
# (invalid statements). # (invalid statements).
assert api.Script('0b2.').completions() == [] assert api.Script('0b2.').completions() == []
_check_number('0b1.', 'int') # binary _check_number('0b1.', 'int') # binary
_check_number('0o7.', 'int') # octal
_check_number('0x2e.', 'int') _check_number('0x2e.', 'int')
_check_number('0xE7.', 'int') _check_number('0xE7.', 'int')

View File

@@ -9,7 +9,7 @@ test_grammar.py files from both Python 2 and Python 3.
from textwrap import dedent from textwrap import dedent
from jedi._compatibility import unicode from jedi._compatibility import unicode, is_py3
from jedi.parser import Parser, load_grammar, ParseError from jedi.parser import Parser, load_grammar, ParseError
import pytest import pytest
@@ -216,7 +216,11 @@ class TestSetLiteral(GrammarTest):
class TestNumericLiterals(GrammarTest): class TestNumericLiterals(GrammarTest):
def test_new_octal_notation(self): def test_new_octal_notation(self):
parse("""0o7777777777777""") code = """0o7777777777777"""
if is_py3:
parse(code)
else:
self.invalid_syntax(code)
self.invalid_syntax("""0o7324528887""") self.invalid_syntax("""0o7324528887""")
def test_new_binary_notation(self): def test_new_binary_notation(self):