Hi Ringo,

if pytest is given a explicit filename, it just goes for the file,

even if it doesn't match the glob for python files when searching
automatically

-- Ronny

Am 12.03.2018 um 17:08 schrieb Ringo De Smet:
> Hello,
>
> I am in the process of implementing a pytest plugin to run mamba tests
> as a pytest plugin. Running pytest without any arguments works
> correctly: pytest picks up tests using the python and unittest plugins
> from the tests folder and picks up the mamba tests from the spec folder.
>
> The problem starts when running pytest with a single spec file as
> argument:
>
> $ pytest spec/action_base_spec.py
> =======================================================================
> test session starts
> ========================================================================
> platform darwin -- Python 3.6.4, pytest-3.4.1, py-1.5.2, pluggy-0.6.0
> rootdir: /Users/ringods/Projects/ontoforce/metis/execution_layer, inifile:
> plugins: mamba-1.0.0
> collected 6 items / 1 errors
>
> ==============================================================================
> ERRORS
> ==============================================================================
> ____________________________________________________________ ERROR
> collecting spec/action_base_spec.py
> _____________________________________________________________
> spec/action_base_spec.py:20: in <module>
>     with description('ActionBase') as self:
> E   AttributeError: __enter__
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> Interrupted: 1 errors during collection
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> =====================================================================
> 1 error in 0.15 seconds
> ======================================================================
>
> This comes from the python plugin in pytest. When running with `-p
> no:python`, this command succeeds.
>
> Why is the python plugin picking up this file, even when it doesn't
> match the regexes `test_*.py` or `*_test.py`?
>
> Ringo
>
>
>
> _______________________________________________
> pytest-dev mailing list
> pytest-dev@python.org
> https://mail.python.org/mailman/listinfo/pytest-dev

_______________________________________________
pytest-dev mailing list
pytest-dev@python.org
https://mail.python.org/mailman/listinfo/pytest-dev

Reply via email to