summaryrefslogtreecommitdiff
path: root/tests/functional/ext/overlapping_exceptions/overlapping_exceptions.py
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-11-23 09:16:15 +0100
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-11-23 09:50:24 +0100
commit8ef3440e51f4391b106ff84b60d07aed69f9dce3 (patch)
tree384fc69b5d6a59b858ffcf658db7465184913a01 /tests/functional/ext/overlapping_exceptions/overlapping_exceptions.py
parent72d3525b058d264bdef1a7f3276b12e4a64162e6 (diff)
downloadpylint-git-8ef3440e51f4391b106ff84b60d07aed69f9dce3.tar.gz
Move the functional tests for extension in 'tests/functional/ext'
Diffstat (limited to 'tests/functional/ext/overlapping_exceptions/overlapping_exceptions.py')
-rw-r--r--tests/functional/ext/overlapping_exceptions/overlapping_exceptions.py66
1 files changed, 66 insertions, 0 deletions
diff --git a/tests/functional/ext/overlapping_exceptions/overlapping_exceptions.py b/tests/functional/ext/overlapping_exceptions/overlapping_exceptions.py
new file mode 100644
index 000000000..c5eab48cc
--- /dev/null
+++ b/tests/functional/ext/overlapping_exceptions/overlapping_exceptions.py
@@ -0,0 +1,66 @@
+# pylint: disable=missing-docstring
+
+import socket
+
+
+class SomeException(Exception):
+ pass
+
+
+class SubclassException(SomeException):
+ pass
+
+
+AliasException = SomeException
+
+try:
+ pass
+except (SomeException, SomeException): # [overlapping-except]
+ pass
+
+try:
+ pass
+except (SomeException, SubclassException): # [overlapping-except]
+ pass
+
+try:
+ pass
+except (SomeException, AliasException): # [overlapping-except]
+ pass
+
+try:
+ pass
+except (AliasException, SubclassException): # [overlapping-except]
+ pass
+
+try:
+ pass
+# +1:[overlapping-except, overlapping-except, overlapping-except]
+except (SomeException, AliasException, SubclassException):
+ pass
+
+try:
+ pass
+except (ArithmeticError, FloatingPointError): # [overlapping-except]
+ pass
+
+try:
+ pass
+except (ValueError, UnicodeDecodeError): # [overlapping-except]
+ pass
+
+
+try:
+ pass
+except (IOError, OSError): # [overlapping-except]
+ pass
+
+try:
+ pass
+except (socket.error, OSError): # [overlapping-except]
+ pass
+
+try:
+ pass
+except (ConnectionError, socket.error): # [overlapping-except]
+ pass