[sympy] Questions for lambda: in raises() (issue #2867)

2011-11-26 Thread Joachim Durchholz
Issue link: http://code.google.com/p/sympy/issues/detail?id=2867 The idea here is to have a lambda expression instead of a string. I.e. instead of >>> raises(TypeError, "Rational(2)*MyInt") we want >>> raises(TypeError, lambda: Rational(2)*MyInt) This works very well, except when the code needs

Re: [sympy] Questions for lambda: in raises() (issue #2867)

2011-11-26 Thread Chris Smith
On Sat, Nov 26, 2011 at 6:51 PM, Joachim Durchholz wrote: > Issue link: http://code.google.com/p/sympy/issues/detail?id=2867 > > The idea here is to have a lambda expression instead of a string. > I.e. instead of raises(TypeError, "Rational(2)*MyInt") > we want raises(TypeError, lambda:

Re: [sympy] Questions for lambda: in raises() (issue #2867)

2011-11-26 Thread Ronan Lamy
Le samedi 26 novembre 2011 à 14:06 +0100, Joachim Durchholz a écrit : > Issue link: http://code.google.com/p/sympy/issues/detail?id=2867 > > The idea here is to have a lambda expression instead of a string. > I.e. instead of > >>> raises(TypeError, "Rational(2)*MyInt") > we want > >>> raises(Typ

Re: [sympy] Questions for lambda: in raises() (issue #2867)

2011-11-26 Thread Joachim Durchholz
Am 26.11.2011 17:22, schrieb Ronan Lamy: As with most problems concerning the test suite, the best solution would be to use pytest: [http://pytest.org/latest/builtin.html#pytest.raises]. How does it avoid the use of strings as parameters? (Note that to use raises() as a context manager, we need

Re: [sympy] Questions for lambda: in raises() (issue #2867)

2011-11-26 Thread Joachim Durchholz
Am 26.11.2011 15:02, schrieb Chris Smith: A) Testing nonassignability: sympy/core/tests/test_assumptions.py, line 393: raises(AttributeError, "x.is_real = False") sympy/core/tests/test_containers.py, line 101: raises(NotImplementedError, "d[5] = 6") # assert immutability Can't these be teste

Re: [sympy] Questions for lambda: in raises() (issue #2867)

2011-11-26 Thread Vladimir Perić
On Sat, Nov 26, 2011 at 5:22 PM, Ronan Lamy wrote: > Le samedi 26 novembre 2011 à 14:06 +0100, Joachim Durchholz a écrit : >> Issue link: http://code.google.com/p/sympy/issues/detail?id=2867 >> >> The idea here is to have a lambda expression instead of a string. >> I.e. instead of >>  >>> raises(T

Re: [sympy] Questions for lambda: in raises() (issue #2867)

2011-11-26 Thread Vladimir Perić
On Sat, Nov 26, 2011 at 5:48 PM, Joachim Durchholz wrote: > Am 26.11.2011 17:22, schrieb Ronan Lamy: >> >> As with most problems concerning the test suite, the best solution would >> be to use pytest: [http://pytest.org/latest/builtin.html#pytest.raises]. > > How does it avoid the use of strings a

Re: [sympy] Questions for lambda: in raises() (issue #2867)

2011-11-26 Thread Joachim Durchholz
Am 26.11.2011 20:58, schrieb Vladimir Perić: On Sat, Nov 26, 2011 at 5:48 PM, Joachim Durchholz wrote: Am 26.11.2011 17:22, schrieb Ronan Lamy: As with most problems concerning the test suite, the best solution would be to use pytest: [http://pytest.org/latest/builtin.html#pytest.raises]. H

Re: [sympy] Questions for lambda: in raises() (issue #2867)

2011-11-26 Thread Ronan Lamy
Le samedi 26 novembre 2011 à 20:54 +0100, Vladimir Perić a écrit : > On Sat, Nov 26, 2011 at 5:22 PM, Ronan Lamy wrote: > > Le samedi 26 novembre 2011 à 14:06 +0100, Joachim Durchholz a écrit : > >> Issue link: http://code.google.com/p/sympy/issues/detail?id=2867 > >> > >> The idea here is to have

Re: [sympy] Questions for lambda: in raises() (issue #2867)

2011-11-26 Thread Aaron Meurer
On Sat, Nov 26, 2011 at 12:54 PM, Vladimir Perić wrote: > On Sat, Nov 26, 2011 at 5:22 PM, Ronan Lamy wrote: >> Le samedi 26 novembre 2011 à 14:06 +0100, Joachim Durchholz a écrit : >>> Issue link: http://code.google.com/p/sympy/issues/detail?id=2867 >>> >>> The idea here is to have a lambda expr

Re: [sympy] Questions for lambda: in raises() (issue #2867)

2011-11-26 Thread Aaron Meurer
On Sat, Nov 26, 2011 at 2:12 PM, Joachim Durchholz wrote: > Am 26.11.2011 20:58, schrieb Vladimir Perić: >> >> On Sat, Nov 26, 2011 at 5:48 PM, Joachim Durchholz >>  wrote: >>> >>> Am 26.11.2011 17:22, schrieb Ronan Lamy: As with most problems concerning the test suite, the best solution

Re: [sympy] Questions for lambda: in raises() (issue #2867)

2011-11-26 Thread Aaron Meurer
On Sat, Nov 26, 2011 at 11:49 PM, Aaron Meurer wrote: > On Sat, Nov 26, 2011 at 12:54 PM, Vladimir Perić > wrote: >> On Sat, Nov 26, 2011 at 5:22 PM, Ronan Lamy wrote: >>> Le samedi 26 novembre 2011 à 14:06 +0100, Joachim Durchholz a écrit : Issue link: http://code.google.com/p/sympy/issue

Re: [sympy] Questions for lambda: in raises() (issue #2867)

2011-11-27 Thread Joachim Durchholz
Am 27.11.2011 07:51, schrieb Aaron Meurer: On Sat, Nov 26, 2011 at 2:12 PM, Joachim Durchholz wrote: I picked that up from http://code.google.com/p/sympy/wiki/DownloadInstallation?tm=2 . Pages on the old wiki are very out of date. Uh-oh. I reached that page from http://sympy.org -> Documen

Re: [sympy] Questions for lambda: in raises() (issue #2867)

2011-11-29 Thread Aaron Meurer
On Sun, Nov 27, 2011 at 4:20 AM, Joachim Durchholz wrote: > Am 27.11.2011 07:51, schrieb Aaron Meurer: >> >> On Sat, Nov 26, 2011 at 2:12 PM, Joachim Durchholz >>  wrote: >>> >>> I picked that up from >>> http://code.google.com/p/sympy/wiki/DownloadInstallation?tm=2 . >> >> Pages on the old wiki a

Re: [sympy] Questions for lambda: in raises() (issue #2867)

2011-11-29 Thread Aaron Meurer
On Tue, Nov 29, 2011 at 7:44 PM, Aaron Meurer wrote: > On Sun, Nov 27, 2011 at 4:20 AM, Joachim Durchholz wrote: >> Am 27.11.2011 07:51, schrieb Aaron Meurer: >>> >>> On Sat, Nov 26, 2011 at 2:12 PM, Joachim Durchholz >>>  wrote: I picked that up from http://code.google.com/p/sympy