[pytest-dev] no self-awareness for pytest

Jason King pizza at netspace.net.au
Fri Jan 8 07:09:05 EST 2016


On 08/01/16 19:49, holger krekel wrote:
> On Fri, Jan 08, 2016 at 08:46 +0000, Floris Bruynooghe wrote:
>> Hi
>>
>> On 8 January 2016 at 06:55, Jason King <pizza at netspace.net.au> wrote:
>> [...]
>>> 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)
>> Can you not pass this directory you want to the py.test commandline
>> then?  E.g. py.test [opts] lib/matplotlib/tests.  That way py.test
>> will only try to collect tests from your test directory instead of
>> everything in you current working directory.
> Also, "py.test -h" reveals there is a "testpaths" setting for the ini
> file where you can positively set the paths/directories where you want
> to see collection happening if no positional arguments are passed to
> pytest.
>
> holger
>
pytest is being called like this:

pytest.main(['--pyargs'] + default_test_modules +
['--ignore=site-packages/numpy/testing/.'])


where default_test_modules is:
[ u'matplotlib.tests.test_agg', u'matplotlib.tests.test_animation', 
u'matplotlib.tests.test_arrow_patches', u'matplotlib.tests.test_artist', 
u'matplotlib.tests.test_axes', u'matplotlib.tests.test_backend_bases', 
u'matplotlib.tests.test_backend_pdf', 
u'matplotlib.tests.test_backend_pgf', 
u'matplotlib.tests.test_backend_ps', 
u'matplotlib.tests.test_backend_qt4', 
u'matplotlib.tests.test_backend_qt5', 
u'matplotlib.tests.test_backend_svg', u'matplotlib.tests.test_basic', 
u'matplotlib.tests.test_bbox_tight', u'matplotlib.tests.test_cbook', 
u'matplotlib.tests.test_coding_standards', 
u'matplotlib.tests.test_collections', u'matplotlib.tests.test_colorbar', 
u'matplotlib.tests.test_colors', 
u'matplotlib.tests.test_compare_images', 
u'matplotlib.tests.test_container', u'matplotlib.tests.test_contour', 
u'matplotlib.tests.test_dates', u'matplotlib.tests.test_delaunay', 
u'matplotlib.tests.test_dviread', u'matplotlib.tests.test_figure', 
u'matplotlib.tests.test_font_manager', 
u'matplotlib.tests.test_gridspec', u'matplotlib.tests.test_image', 
u'matplotlib.tests.test_legend', u'matplotlib.tests.test_lines', 
u'matplotlib.tests.test_mathtext', u'matplotlib.tests.test_mlab', 
u'matplotlib.tests.test_offsetbox', u'matplotlib.tests.test_patches', 
u'matplotlib.tests.test_path', u'matplotlib.tests.test_patheffects', 
u'matplotlib.tests.test_pickle', u'matplotlib.tests.test_png', 
u'matplotlib.tests.test_quiver', u'matplotlib.tests.test_rcparams', 
u'matplotlib.tests.test_scale', u'matplotlib.tests.test_simplification', 
u'matplotlib.tests.test_spines', u'matplotlib.tests.test_streamplot', 
u'matplotlib.tests.test_style', u'matplotlib.tests.test_subplots', 
u'matplotlib.tests.test_table', u'matplotlib.tests.test_text', 
u'matplotlib.tests.test_texmanager', u'matplotlib.tests.test_ticker', 
u'matplotlib.tests.test_tightlayout', 
u'matplotlib.tests.test_transforms', 
u'matplotlib.tests.test_triangulation', 
u'matplotlib.tests.test_type1font', u'matplotlib.tests.test_units', 
u'matplotlib.tests.test_widgets', u'matplotlib.tests.test_cycles', 
u'matplotlib.tests.test_labeled_data_unpacking', 
u'matplotlib.sphinxext.tests.test_tinypages', 
u'mpl_toolkits.tests.test_mplot3d', 
u'mpl_toolkits.tests.test_axes_grid1', u'mpl_toolkits.tests.test_axes_grid']

Which should be specifying where to look for the tests

I'll give testpaths a go and see what happens.


More information about the pytest-dev mailing list