Repository: sympy/sympy

Issue:
Intermittent test failure in assumptions
This test fails intermittently on Python 3.5 or 3.6:
```console
$ pytest sympy/core/tests/test_arit.py -k test_Add_Mul_is_finite
==================================================================== test session starts =====================================================================
platform darwin -- Python 3.5.7, pytest-4.3.1, py-1.8.0, pluggy-0.9.0
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/Users/enojb/current/sympy/sympy/.hypothesis/examples')
architecture: 64-bit
cache:        yes
ground types: gmpy 1.17

rootdir: /Users/enojb/current/sympy/sympy, inifile: pytest.ini
plugins: xdist-1.27.0, instafail-0.4.1, forked-1.0.2, doctestplus-0.3.0, cov-2.7.1, hypothesis-4.32.3
collected 88 items / 87 deselected / 1 selected                                                                                                              

sympy/core/tests/test_arit.py F                                                                                                                        [100%]

========================================================================== FAILURES ==========================================================================
___________________________________________________________________ test_Add_Mul_is_finite ___________________________________________________________________

    def test_Add_Mul_is_finite():
        x = Symbol('x', extended_real=True, finite=False)
    
        assert sin(x).is_finite is True
        assert (x*sin(x)).is_finite is None
        assert (x*atan(x)).is_finite is False
        assert (1024*sin(x)).is_finite is True
>       assert (sin(x)*exp(x)).is_finite is None
E       assert False is None
E        +  where False = (sin(x) * exp(x)).is_finite
E        +    where sin(x) = sin(x)
E        +    and   exp(x) = exp(x)

sympy/core/tests/test_arit.py:390: AssertionError
```

Discussion:
sympy-bot: :white_check_mark:

Hi, I am the [SymPy bot](https://github.com/sympy/sympy-bot) (v149). I'm here to help you write a release notes entry. Please read the [guide on how to write release notes](https://github.com/sympy/sympy/wiki/Writing-Release-Notes).



* No release notes entry will be added for this pull request.

Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it. <details><summary>Click here to see the pull request description that was parsed.</summary>

    <!-- Your title above should be a short description of what
    was changed. Do not include the issue number in the title. -->

    #### References to other Issues or PRs
    <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
    format, e.g. "Fixes #1234". See
    https://github.com/blog/1506-closing-issues-via-pull-requests . Please also
    write a comment on that issue linking back to this pull request once it is
    open. -->

    Fixes #17789 

    #### Brief description of what is fixed or changed

    Fixes exp.is_complex so that it understands that infinite non-complex inputs like oo and -oo do not necessarily mean that exp(x) is not complex.

    #### Other comments


    #### Release Notes

    <!-- Write the release notes for this release below. See
    https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more information
    on how to write release notes. The bot will check your release notes
    automatically to see if they are formatted correctly. -->

    <!-- BEGIN RELEASE NOTES -->
    NO ENTRY
    <!-- END RELEASE NOTES -->


</details><p>


Patch:
diff --git a/sympy/functions/elementary/exponential.py b/sympy/functions/elementary/exponential.py
index d357e5e25a..5dd62e059a 100644
--- a/sympy/functions/elementary/exponential.py
+++ b/sympy/functions/elementary/exponential.py
@@ -6,7 +6,7 @@
 from sympy.core.compatibility import range
 from sympy.core.function import (Function, ArgumentIndexError, _coeff_isneg,
         expand_mul)
-from sympy.core.logic import fuzzy_and, fuzzy_not
+from sympy.core.logic import fuzzy_and, fuzzy_not, fuzzy_or
 from sympy.core.mul import Mul
 from sympy.core.numbers import Integer, Rational
 from sympy.core.power import Pow
@@ -402,7 +402,10 @@ def _eval_is_extended_real(self):
             return arg2.is_even
 
     def _eval_is_complex(self):
-        return self.args[0].is_complex
+        def complex_extended_negative(arg):
+            yield arg.is_complex
+            yield arg.is_extended_negative
+        return fuzzy_or(complex_extended_negative(self.args[0]))
 
     def _eval_is_algebraic(self):
         s = self.func(*self.args)


Test patch:
diff --git a/sympy/functions/elementary/tests/test_exponential.py b/sympy/functions/elementary/tests/test_exponential.py
index 11094e9c14..17b1b12fd9 100644
--- a/sympy/functions/elementary/tests/test_exponential.py
+++ b/sympy/functions/elementary/tests/test_exponential.py
@@ -108,6 +108,8 @@ def test_exp_infinity():
     assert refine(exp(-I*oo)) is nan
     assert exp(y*I*oo) != nan
     assert exp(zoo) is nan
+    x = Symbol('x', extended_real=True, finite=False)
+    assert exp(x).is_complex is None
 
 
 def test_exp_subs():