forked from Vauxoo/pylint-odoo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] except-pass: Emit message If a except:pass is used fix OCA#252
[FIX] pylint-odoo: Best use of if clause [FIX] pylint-odoo: Validate the body contain only one line [FIX] pylint-odoo: Avoid use \ better use ( [REF] incoherent-interpreter-exec-perm: Better message (Vauxoo#106) [ADD] xml-attribute-translatable: Check XML attribute without translation parameter (Vauxoo#105) Close OCA#104 [REF] javascript-lint: Use eslint instead of jshint (Vauxoo#97) [ADD] renamed-field-parameter: Detect deprecated field values (digits_compute, select) (Vauxoo#99) [FIX] Pep8 check and bad index for ODOO_MSGS [ADD] attribute-string-redundant: Check if "string" parameter is equal to variable name (Vauxoo#100) [FIX] attribute-string-redundant: Add "isinstance" validation for nodes Fix OCA#109 [IMP] Exclude exception when use as assignation [FIX] Pep8 check local variable 'exception' [FIX] Pep8 blank line at end of file [FIX] Adding more cases of test [REF] Supporting more cases of exception [FIX] Modify file main.py for adding new case of except-pass [IMP] Adding another tests case [FIX] Adding another test case and better validation [FIX] Delete unnecessary condition of if [FIX] Fix comment line
- Loading branch information
JesusZapata
committed
Jan 31, 2017
1 parent
93cf3b2
commit daf67df
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Test Except Pass usage""" | ||
|
||
|
||
class TestExceptPass(object): | ||
"""Test Except Pass class """ | ||
|
||
def test_method(self): | ||
"""Test method """ | ||
try: | ||
raise Exception('Exception') | ||
except Exception: # except-pass | ||
pass | ||
|
||
def test_2_method(self): | ||
"""Test 2 method """ | ||
try: | ||
raise Exception('Exception') | ||
except Exception: | ||
pass | ||
print('Exception') | ||
|
||
def test_3_method(self): | ||
"""Test 3 method """ | ||
try: | ||
raise Exception('Exception') | ||
except Exception as exception: | ||
pass | ||
if exception: | ||
pass | ||
|
||
def test_4_method(self): | ||
try: | ||
raise Exception('Exception') | ||
except Exception, userError: | ||
pass | ||
if userError: | ||
pass | ||
|
||
def test_5_method(self): | ||
try: | ||
raise Exception('Exception') | ||
except (Exception, IndexError) as exception: | ||
pass | ||
if exception: | ||
pass | ||
|
||
def test_6_method(self): | ||
try: | ||
raise Exception('Exception') | ||
except (Exception, IndexError): # except-pass | ||
pass | ||
|
||
def test_7_method(self): | ||
try: | ||
raise Exception('Exception') | ||
except (Exception, IndexError, NameError), exception: | ||
pass | ||
except Exception: # except-pass | ||
pass | ||
if exception: | ||
pass |