pytest adoption: current status (beginning of May)
Thomas De Schampheleire
patrickdepinguin at gmail.com
Sat May 9 15:12:46 EDT 2015
On Wed, May 6, 2015 at 11:25 PM, Marc Abramowitz <msabramo at gmail.com> wrote:
> Also, and the following doesn't require installing any plugins:
>
> py.test -r fEsxXw
>
> That looks pretty unintelligible but basically you're telling the -r
> (report) option what to display more info about. Do `pytest --help` and look
> at the documentation for -r and it shows you what all those letters mean.
>
> If you want this to be the default whenever running `py.test`, you can set
> it in pytest.ini or set an environment variable. See
> https://pytest.org/latest/customize.html#adding-default-options
>
> One of the projects that I work on has a pytest.ini that looks like this:
>
> [pytest]
> norecursedirs = build docs/_build SQLAlchemy* .* stuff venv *.egg .tox
> *.venv
> addopts =
> # --verbose
> --tb short
> # --capture no
> # show extra test summary info as specified by chars (f)ailed, (E)error,
> (s)skipped, (x)failed, (X)passed.
> -rfEsxX
> # --junitxml=junit.xml
> # --cov=pymssql --cov-report=xml --cov-report=term-missing
> markers =
> slow: Mark a pymssql test as slow (usually taking more one second or
> more).
Thanks for all this feedback Marc!
I played with the different options suggested, and here is my feedback:
-r fEsxXw gives the regular pytest output + the short summary at the
end, so this is definitely useful.
--tb=short is also something I find useful: it greatly reduces the
output shown while the most important stuff is still present
pytest-sugar also looks a nice addition: the biggest improvement being
the showing of errors from the moment they occurred. In addition it
also shows a test summary at the end, but only the file + line number
+ error description, while the '-r fEsxXw' option to pytest shows file
+ class + method name. Both thus complement each other.
My suggestion is thus to add pytest and pytest-sugar to the kallithea
dependencies, and '-rfEsxXw --tb=short' to the test configuration
file.
What do others say?
Thanks,
Thomas
More information about the kallithea-general
mailing list