mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-08 13:45:01 +08:00
Add some tests for python3.
This commit is contained in:
@@ -442,6 +442,9 @@ class PEP8Normalizer(Normalizer):
|
|||||||
def _check_spacing(self, leaf, info):
|
def _check_spacing(self, leaf, info):
|
||||||
spaces = info.indentation
|
spaces = info.indentation
|
||||||
prev = self._previous_leaf
|
prev = self._previous_leaf
|
||||||
|
if prev is not None and prev.type == 'error_leaf' or leaf.type == 'error_leaf':
|
||||||
|
return
|
||||||
|
|
||||||
if '\t' in spaces:
|
if '\t' in spaces:
|
||||||
self.add_issue(223, 'Used tab to separate tokens', info.indentation_part)
|
self.add_issue(223, 'Used tab to separate tokens', info.indentation_part)
|
||||||
elif len(spaces) > 1:
|
elif len(spaces) > 1:
|
||||||
|
|||||||
18
test/normalizer_issue_files/python3.py
Normal file
18
test/normalizer_issue_files/python3.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
from typing import ClassVar, List
|
||||||
|
|
||||||
|
|
||||||
|
# Annotated function (Issue #29)
|
||||||
|
def foo(x: int) -> int:
|
||||||
|
return x + 1
|
||||||
|
|
||||||
|
|
||||||
|
# Annotated variables #575
|
||||||
|
CONST: int = 42
|
||||||
|
|
||||||
|
|
||||||
|
class Class:
|
||||||
|
cls_var: ClassVar[str]
|
||||||
|
|
||||||
|
def m(self):
|
||||||
|
xs: List[int] = []
|
||||||
Reference in New Issue
Block a user