[Matplotlib-devel] our tests

Nathaniel Smith njs at pobox.com
Sat Jan 28 14:49:46 EST 2017


On Jan 28, 2017 8:06 AM, "Eric Firing" <efiring.ocean at gmail.com> wrote:

Does anyone know why:

1) In our Travis suite, the USE_PYTEST run takes much longer than the
others.

2) On master (approximately), when I try to run a single function with
py.test, it isn't found.  Example:

py.test lib/matplotlib/tests/test_axes.py::test_hist_steplog


I've never figured out the syntax for naming a single test -- I think it
might vary depending on things like whether your test directories are
packages? Pytest pulls configuration from the files and directories around
each test, so it kind of needs to "see" the whole test tree.

But, I did (after an embarrassingly long time) discover the fabulous -k
switch. The idea is you run pytest normally so it can see your whole test
suite, but then "-k hist_steplog" tells it to ignore any tests whose name
doesn't have that as a substring.

-n
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20170128/2db922cd/attachment.html>


More information about the Matplotlib-devel mailing list