[pytest-dev] no self-awareness for pytest

Jason King pizza at netspace.net.au
Tue Jan 19 07:37:07 EST 2016

On 09/01/16 00:56, Ionel Cristian Mărieș wrote:
> Would collection hooks help you here? Eg: skip/filter files that 
> aren't part of matplotlib.
> pytest.org/latest/writing_plugins.html#collection-hooks 
> <http://pytest.org/latest/writing_plugins.html#collection-hooks>

I followed your suggestion, and made a plugin that didn't allow files 
that had 'numpy' in its path,
but the plugin never activated on such a file.

so I think I've tracked down whats causing the problem I was experiencing:

just to recap, I was getting an error of this (twice)

_________ __ ERROR at setup of test ____________________________

line 249

def test(self, label='fast', verbose=1, extra_argv=None, doctests=False,

fixture 'self' not found

available fixtures: tmpdir_factory, pytestconfig, cov, cache, recwarn, 
monkeypatch, record_xml_property, capfd, capsys, tmpdir

use 'py.test --fixtures [testpath]' for help on them.

/hom e/travis/ 

as it turns out, there were two files that was causing the error, and 
the line that seems to be doing it is..

from pylab import *

yup, a import statement was doing it.  only reason I found it was 
because of the instafail plugin (5 tests after a stack trace of a 
failing test, the pytest error appeared)

Is it possible to have pytest print out the name  of the test that its 
about to do , with the result , instead of ".....E.xsss..." etc?
That would make weird occurrences/errors easier to find in future.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20160119/6de1e183/attachment-0001.html>

More information about the pytest-dev mailing list