[pytest-dev] Not running standard pytest collector for file spec/*_spec.py
Ringo De Smet
ringo.de.smet at ontoforce.com
Tue Mar 13 03:39:54 EDT 2018
On Mon, Mar 12, 2018 at 8:10 PM, Bruno Oliveira <nicoddemus at gmail.com>
> Hi Ringo,
> It is as Ronny said, you can see the code responsible for that here:
> When the file has a `.py` extension and is one of the "inipaths" (paths
> given explicitly in the command line), then the `python` plugin will
> collect that file anyway.
That's a pitty. Given the pluggability of pytest, each plugin could have a
way to collect files and offer test suites back to pytest. Isn't there a
way to specify one of my spec tests without the wrong plugin(s) picking up
> You can override this by implementing your own `pytest_collect_file` and
> return non-`None` when a `.py` file inside the specs directory is passed in
> the command-line.
Bruno, my plugin is collecting the file specified on the command line
correctly, but still the python plugin tries to run it too. That's where it
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the pytest-dev