mirror of
https://github.com/davidhalter/parso.git
synced 2026-01-28 22:02:42 +08:00
Create the first tests for the pydocstyle finder.
This commit is contained in:
78
test/normalizer_issue_files/E72.py
Normal file
78
test/normalizer_issue_files/E72.py
Normal file
@@ -0,0 +1,78 @@
|
||||
#: E721
|
||||
if type(res) == type(42):
|
||||
pass
|
||||
#: E721
|
||||
if type(res) != type(""):
|
||||
pass
|
||||
|
||||
import types
|
||||
|
||||
if res == types.IntType:
|
||||
pass
|
||||
|
||||
import types
|
||||
|
||||
#: E721:3
|
||||
if type(res) is not types.ListType:
|
||||
pass
|
||||
#: E721:7 E721:35
|
||||
assert type(res) == type(False) or type(res) == type(None)
|
||||
#: E721:7
|
||||
assert type(res) == type([])
|
||||
#: E721:7
|
||||
assert type(res) == type(())
|
||||
#: E721:7
|
||||
assert type(res) == type((0,))
|
||||
#: E721:7
|
||||
assert type(res) == type((0))
|
||||
#: E721:7
|
||||
assert type(res) != type((1, ))
|
||||
#: E721:7
|
||||
assert type(res) is type((1, ))
|
||||
#: E721:7
|
||||
assert type(res) is not type((1, ))
|
||||
|
||||
# Okay
|
||||
import types
|
||||
|
||||
if isinstance(res, int):
|
||||
pass
|
||||
if isinstance(res, str):
|
||||
pass
|
||||
if isinstance(res, types.MethodType):
|
||||
pass
|
||||
|
||||
#: E721:3 E721:25
|
||||
if type(a) != type(b) or type(a) == type(ccc):
|
||||
pass
|
||||
#: E721
|
||||
type(a) != type(b)
|
||||
#: E721
|
||||
1 != type(b)
|
||||
#: E721
|
||||
type(b) != 1
|
||||
1 != 1
|
||||
|
||||
try:
|
||||
pass
|
||||
#: E722
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
pass
|
||||
except Exception:
|
||||
pass
|
||||
#: E722
|
||||
except:
|
||||
pass
|
||||
# Okay
|
||||
fake_code = """"
|
||||
try:
|
||||
do_something()
|
||||
except:
|
||||
pass
|
||||
"""
|
||||
try:
|
||||
pass
|
||||
except Exception:
|
||||
pass
|
||||
29
test/normalizer_issue_files/LICENSE
Normal file
29
test/normalizer_issue_files/LICENSE
Normal file
@@ -0,0 +1,29 @@
|
||||
Copyright © 2006-2009 Johann C. Rocholl <johann@rocholl.net>
|
||||
Copyright © 2009-2014 Florent Xicluna <florent.xicluna@gmail.com>
|
||||
Copyright © 2014-2016 Ian Lee <IanLee1521@gmail.com>
|
||||
Copyright © 2014-2017 Dave Halter <davidhalter88@gmail.com>
|
||||
|
||||
Dave: The files in this folder were ported from pydocstyle and some
|
||||
modifications where made.
|
||||
|
||||
Licensed under the terms of the Expat License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation files
|
||||
(the "Software"), to deal in the Software without restriction,
|
||||
including without limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
Reference in New Issue
Block a user