mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-21 20:01:21 +08:00
Add some normalizer tests about imports.
This commit is contained in:
39
test/normalizer_issue_files/E40.py
Normal file
39
test/normalizer_issue_files/E40.py
Normal file
@@ -0,0 +1,39 @@
|
||||
#: E401:7
|
||||
import os, sys
|
||||
# Okay
|
||||
import os
|
||||
import sys
|
||||
|
||||
from subprocess import Popen, PIPE
|
||||
|
||||
from myclass import MyClass
|
||||
from foo.bar.yourclass import YourClass
|
||||
|
||||
import myclass
|
||||
import foo.bar.yourclass
|
||||
# All Okay from here until the definition of VERSION
|
||||
__all__ = ['abc']
|
||||
|
||||
import foo
|
||||
__version__ = "42"
|
||||
|
||||
import foo
|
||||
__author__ = "Simon Gomizelj"
|
||||
|
||||
import foo
|
||||
try:
|
||||
import foo
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
print('imported foo')
|
||||
finally:
|
||||
print('made attempt to import foo')
|
||||
|
||||
import bar
|
||||
VERSION = '1.2.3'
|
||||
|
||||
#: E402
|
||||
import foo
|
||||
#: E402
|
||||
import foo
|
||||
Reference in New Issue
Block a user