summaryrefslogtreecommitdiff
path: root/pylint
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2019-06-01 11:33:38 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2019-06-01 11:33:38 +0200
commita0a178cab6b7c823ca0aba2307723e7abe6ab516 (patch)
treed208d0c5cf5cc19549f7e5c70cad9a1ae02857db /pylint
parentd14440fe280a25439c76e53455b4831e04c4bb17 (diff)
downloadpylint-git-a0a178cab6b7c823ca0aba2307723e7abe6ab516.tar.gz
Add test for fixed issue. Close #2937
Diffstat (limited to 'pylint')
-rw-r--r--pylint/test/functional/regression_2937_ifexp.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/pylint/test/functional/regression_2937_ifexp.py b/pylint/test/functional/regression_2937_ifexp.py
new file mode 100644
index 000000000..55b240440
--- /dev/null
+++ b/pylint/test/functional/regression_2937_ifexp.py
@@ -0,0 +1,20 @@
+# pylint: disable=missing-docstring,no-else-return,using-constant-test
+def get_list():
+ return [1] if True else [2]
+
+
+def find_int():
+ return int(get_list()[0])
+
+
+def func():
+ if True:
+ return find_int()
+ else:
+ return find_int()
+
+
+def test():
+ resp = func()
+ assert resp / resp > 0
+ return resp