From a0a178cab6b7c823ca0aba2307723e7abe6ab516 Mon Sep 17 00:00:00 2001 From: Claudiu Popa Date: Sat, 1 Jun 2019 11:33:38 +0200 Subject: Add test for fixed issue. Close #2937 --- pylint/test/functional/regression_2937_ifexp.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pylint/test/functional/regression_2937_ifexp.py (limited to 'pylint') 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 -- cgit v1.2.1