[SciPy-Dev] [GSoC 2017] Nose to Pytest Migration - conclusions from previous thread

josef.pktd at gmail.com josef.pktd at gmail.com
Sun Mar 12 11:15:18 EDT 2017


On Sun, Mar 12, 2017 at 11:09 AM, Nathaniel Smith <njs at pobox.com> wrote:
> On Mar 12, 2017 7:56 AM, "Robert Kern" <robert.kern at gmail.com> wrote:
>
> On Sun, Mar 12, 2017 at 12:19 AM, Karan Desai <karandesai281196 at gmail.com>
> wrote:
>> Plain assert keyword statements.
>
> Just a note: numpy's test suite, at least, must not use `assert` statements.
> numpy's test suite must be runnable under `python -O`. numpy does some
> docstring manipulation that could fail in principle under those conditions
> (i.e. it did fail at one point until we fixed it, so now we have to ensure
> that it doesn't regress). scipy might have the same issue (e.g.
> `scipy.special` ufuncs and `scipy.stats` distribution objects), but I forget
> if we've made that a policy there too.
>
> So if you mean, by this requirement, that we convert all of our
> `assert_equal(x, y)` calls to `assert x == y`, no, we won't be doing that,
> even in the cases where it would be possible.
>
>
> Pytest arranges for assert statements in test modules to be run even if
> Python has assert statements disabled in general. See
>
> http://doc.pytest.org/en/latest/announce/release-2.1.0.html

sounds way too magic to me

I like the numpy asserts,
no statements just nice functions with options instead of magic code rewriting.

(and assert_allclose has better defaults than np.allclose)

Josef


>
> -n
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/scipy-dev
>



More information about the SciPy-Dev mailing list