30 lines
948 B
Plaintext
30 lines
948 B
Plaintext
Changing standard (Python) test discovery
|
|
===============================================
|
|
|
|
changing directory recursion
|
|
-----------------------------------------------------
|
|
|
|
You can set the :confval:`norecursedirs` option in an ini-file, for example your ``setup.cfg`` in the project root directory::
|
|
|
|
# content of setup.cfg
|
|
[pytest]
|
|
norecursedirs = .svn _build tmp*
|
|
|
|
This would tell py.test to not recurse into typical subversion or sphinx-build directories or into any ``tmp`` prefixed directory.
|
|
|
|
|
|
finding out what is collected
|
|
-----------------------------------------------
|
|
|
|
You can always peek at the collection tree without running tests like this::
|
|
|
|
$ py.test --collectonly collectonly.py
|
|
<Directory 'example'>
|
|
<Module 'test_collectonly.py'>
|
|
<Function 'test_function'>
|
|
<Class 'TestClass'>
|
|
<Instance '()'>
|
|
<Function 'test_method'>
|
|
<Function 'test_anothermethod'>
|
|
|