<div dir="ltr">FWIW there is an open issue (generally approved by the pytest devs) to simplify selection of a single test: <a href="https://github.com/pytest-dev/pytest/issues/2193">https://github.com/pytest-dev/pytest/issues/2193</a></div><div class="gmail_extra"><br><div class="gmail_quote">2017-01-28 11:49 GMT-08:00 Nathaniel Smith <span dir="ltr"><<a href="mailto:njs@pobox.com" target="_blank">njs@pobox.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><span class=""><div><div class="gmail_extra"><div class="gmail_quote">On Jan 28, 2017 8:06 AM, "Eric Firing" <<a href="mailto:efiring.ocean@gmail.com" target="_blank">efiring.ocean@gmail.com</a>> wrote:<br type="attribution"><blockquote class="m_-2929285794252142772quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Does anyone know why:<br>
<br>
1) In our Travis suite, the USE_PYTEST run takes much longer than the others.<br>
<br>
2) On master (approximately), when I try to run a single function with py.test, it isn't found.  Example:<br>
<br>
py.test lib/matplotlib/tests/test_axes<wbr>.py::test_hist_steplog<br></blockquote></div></div></div><div dir="auto"><br></div></span><div dir="auto">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.</div><div dir="auto"><br></div><div dir="auto">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.</div><span class="HOEnZb"><font color="#888888"><div dir="auto"><br></div><div dir="auto">-n</div></font></span></div>
<br>______________________________<wbr>_________________<br>
Matplotlib-devel mailing list<br>
<a href="mailto:Matplotlib-devel@python.org">Matplotlib-devel@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/matplotlib-devel" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/matplotlib-<wbr>devel</a><br>
<br></blockquote></div><br></div>