0.6.3 cannot import name Outcome on py24/25

9 views
Skip to first unread message

Oyster

unread,
Nov 20, 2008, 9:19:39 PM11/20/08
to sympy
it is so strange, I have installed py lib 0.9.2, but
[code]
>>> from py.__.test.outcome import *
>>> dir()
['EXIT_INTERNALERROR', 'EXIT_INTERRUPTED', 'EXIT_NOHOSTS', 'EXIT_OK',
'EXIT_TESTSFAILED', 'ExceptionFailure', 'Exit', 'Failed',
'OutcomeException', 'Passed', 'Skipped', '__builtins__', '__doc__',
'__name__', 'deprecated_call', 'exit', 'fail
', 'importorskip', 'py', 'raises', 'skip', 'sys']
[/code]
you can find the is no Outcome

so I changed sympy\utilities\pytest.py
[code]
from pytest import raises
[/code]
to
[code]
#from pytest import raises
[/code]

else

[code]
>>> from sympy import Symbol, cos

Traceback (most recent call last):
File "<pyshell#0>", line 1, in -toplevel-
from sympy import Symbol, cos
File "H:\pure_pylib\math\sympy\sympy\__init__.py", line 18, in -
toplevel-
from polys import *
File "H:\pure_pylib\math\sympy\sympy\polys\__init__.py", line 2, in -
toplevel-
from monomial import monomials, monomial_count
File "H:\pure_pylib\math\sympy\sympy\polys\monomial.py", line 6, in -
toplevel-
from sympy.functions import factorial
File "H:\pure_pylib\math\sympy\sympy\functions\__init__.py", line 9,
in -toplevel-
import combinatorial
File "H:\pure_pylib\math\sympy\sympy\functions\combinatorial
\__init__.py", line 3, in -toplevel-
import numbers
File "H:\pure_pylib\math\sympy\sympy\functions\combinatorial
\numbers.py", line 20, in -toplevel-
from sympy.utilities.memoization import recurrence_memo
File "H:\pure_pylib\math\sympy\sympy\utilities\__init__.py", line
20, in -toplevel-
from pytest import raises
File "H:\pure_pylib\math\sympy\sympy\utilities\pytest.py", line 47,
in -toplevel-
from py.__.test.outcome import Outcome, Passed, Failed, Skipped
ImportError: cannot import name Outcome
[/code]

Ondrej Certik

unread,
Nov 21, 2008, 3:50:31 AM11/21/08
to sy...@googlegroups.com
On Fri, Nov 21, 2008 at 3:19 AM, Oyster <lepto....@gmail.com> wrote:
>
> it is so strange, I have installed py lib 0.9.2, but
> [code]
>>>> from py.__.test.outcome import *
>>>> dir()
> ['EXIT_INTERNALERROR', 'EXIT_INTERRUPTED', 'EXIT_NOHOSTS', 'EXIT_OK',
> 'EXIT_TESTSFAILED', 'ExceptionFailure', 'Exit', 'Failed',
> 'OutcomeException', 'Passed', 'Skipped', '__builtins__', '__doc__',
> '__name__', 'deprecated_call', 'exit', 'fail
> ', 'importorskip', 'py', 'raises', 'skip', 'sys']
> [/code]
> you can find the is no Outcome

With py.test 0.9.1-3:

In [1]: from py.__.test.outcome import Outcome

In [2]: Outcome
Out[2]: <class py.__.test.outcome.Outcome at 0xb76f9b9c>

So they changed the interface and it breaks sympy. In
sympy/utilities/py.test we have:

try:
import py
disabled = False
except ImportError:
disabled = True


So normally it is disabled and not used if the py.test is not
installed. Thanks for noticing this, it is a bug and the fix is to
move all the imports into the "try" clause above.

http://code.google.com/p/sympy/issues/detail?id=1210

Ondrej

Ondrej Certik

unread,
Nov 27, 2008, 8:15:57 AM11/27/08
to sy...@googlegroups.com
Hi Oyster,

could you please try our latest git versino? You can download a zip file here:

http://git.sympy.org/?p=sympy.git;a=snapshot;h=HEAD;sf=zip

It should be fixed.

Ondrej

Oyster

unread,
Dec 2, 2008, 3:31:57 AM12/2/08
to sympy
thanx, the git version works
Reply all
Reply to author
Forward
0 new messages