Thank you, Michael and Steve, for the quick responses.

I will open a PR on github with changes to take in consideration what you said.

@Steve:
Sure you can explicitly tell py.test to run a specific test module,
but the whole point of my suggestion is to not pass test module path
to py.test. It's the point of view of a beginner, not familiar with
Pyramid scaffolds nor py.test: isn't it easier/more convenient to only
run ``py.test`` at project's root directory, just after project
creation by scaffold, and get all tests collected by default?

-- Vincent

2016-05-05 19:46 GMT+02:00 Steve Piercy <steve.piercy....@gmail.com>:
> On 5/5/16 at 9:44 AM, vincent.fero...@gmail.com (Vincent Férotin)
> pronounced:
>
>> scaffolds are not ready for naive usage of py.test by new comers to
>> Pyramid,
>> i.e. running ``py.test [--cov]`` at new project's root collects no tests.
>
>
> You are correct in that one cannot just naïvely run:
>
>     $ py.test [--cov]
>
> py.test discovers tests in the following manner:
> http://pytest.org/latest/goodpractices.html#python-test-discovery
>
> By following the instructions for the SQLAlchemy + URL dispatch wiki
> tutorial to get started:
> http://docs.pylonsproject.org/projects/pyramid/en/1.7-branch/tutorials/wiki2/installation.html
>
> I can run the tests:
>
> stevepi-mbp:tutorial stevepiercy$ $VENV/bin/py.test tutorial/tests.py -q
> ..
> 2 passed in 0.54 seconds
>
> stevepi-mbp:tutorial stevepiercy$ $VENV/bin/py.test --cov=tutorial
> --cov-report=term-missing tutorial/tests.py
> ======================================================================= test
> session starts
> ========================================================================
> platform darwin -- Python 3.5.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
> rootdir: /Users/stevepiercy/pyramidtut/tutorial, inifile:
> plugins: cov-2.2.1
> collected 2 items
>
> tutorial/tests.py ..
> --------------------------------------------------------- coverage: platform
> darwin, python 3.5.0-final-0
> ----------------------------------------------------------
> Name                               Stmts   Miss  Cover   Missing
> ----------------------------------------------------------------
> tutorial/__init__.py                   8      6    25%   7-12
> tutorial/models/__init__.py           22      0   100%
> tutorial/models/meta.py                5      0   100%
> tutorial/models/mymodel.py             8      0   100%
> tutorial/routes.py                     3      3     0%   1-3
> tutorial/scripts/__init__.py           0      0   100%
> tutorial/scripts/initializedb.py      26     26     0%   1-45
> tutorial/tests.py                     39      0   100%
> tutorial/views/__init__.py             0      0   100%
> tutorial/views/default.py             12      0   100%
> tutorial/views/notfound.py             4      4     0%   1-7
> ----------------------------------------------------------------
> TOTAL                                127     39    69%
>
> ===================================================================== 2
> passed in 0.57 seconds
> =====================================================================
> stevepi-mbp:tutorial stevepiercy$
>
> --steve
>
> ------------------------
> Steve Piercy, Soquel, CA
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pylons-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to pylons-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/pylons-devel.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-devel+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/pylons-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to