[pytest-dev] no self-awareness for pytest
Jason King
pizza at netspace.net.au
Fri Jan 8 01:55:16 EST 2016
Hi, I'm most of the way through a conversion of matplotlib to using
pytest instead of nose, and I'm having a problem.
PR is here https://github.com/matplotlib/matplotlib/pull/5405
Th is is the error text I'm getting:
==================================== ERRORS
====================================
____________________________ ERROR at setup of test
____________________________
file
/home/travis/build/matplotlib/matplotlib/venv/lib/python2.7/site-packages/numpy/testing/nosetester.py,
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.
/home/travis/build/matplotlib/matplotlib/venv/lib/python2.7/site-packages/numpy/testing/nosetester.py:249
____________________________ ERROR at setup of test
____________________________
file
/home/travis/build/matplotlib/matplotlib/venv/lib/python2.7/site-packages/numpy/testing/nosetester.py,
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.
/home/travis/build/matplotlib/matplotlib/venv/lib/python2.7/site-packages/numpy/testing/nosetester.py:249
3571 passed, 9 skipped, 28 xfailed, 2 pytest-warnings, 2 error in 120.55
seconds
So it seems to be locating a function called 'test' in numpy's
nosetester.py file, thats in the virtualenv, and trying to set
it up as a test. Which isn't what I want. (I only want tests located
in matplotlib's install directory)
I've tried specifying "numpy" in tox.ini's [pytest] norecursedir option,
but pytest seems to be ignoring that. Also tried
using '--ignore=site-packages/numpy/testing/.' as a string in the list
that is given to pytest.main(). and last, as a joke,
tried creating a fixture called 'self' but it seemed to ignore that too.
Does anyone know how to make pytest self-aware so it can take on skynet.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20160108/9209674c/attachment.html>
More information about the pytest-dev
mailing list