Apply modifications requested in review

This commit is contained in:
Bruno Oliveira 2017-07-28 07:55:34 -03:00
parent 6fe7069cbb
commit 7082320f3f
2 changed files with 9 additions and 5 deletions

View File

@ -174,11 +174,15 @@ Or to select "http" and "quick" tests::
.. note::
If you are using expressions such as ``"X and Y"`` then both ``X`` and ``Y``
need to be simple non-keyword names. For example, ``"pass"`` or ``"from"``
will result in SyntaxErrors because ``"-k"`` evaluates the expression using Python's ``eval`` function.
need to be simple non-keyword names. For example, ``"pass"`` or ``"from"``
will result in SyntaxErrors because ``"-k"`` evaluates the expression using
Python's `eval`_ function.
.. _`eval`: https://docs.python.org/3.6/library/functions.html#eval
However, if the ``"-k"`` argument is a simple string, no such restrictions
apply. Also ``"-k 'not STRING'"`` has no restrictions. You can also
apply. Also ``"-k 'not STRING'"`` has no restrictions. You can also
specify numbers like ``"-k 1.3"`` to match tests which are parametrized
with the float ``"1.3"``.

View File

@ -198,5 +198,5 @@ was executed ahead of the ``test_method``.
The above ``usefixtures`` and ``autouse`` examples should help to mix in
pytest fixtures into unittest suites.
You can also consider incrementally leave away ``unittest.TestCase`` subclassing,
using plain asserts and get the full pytest feature set.
You can also gradually move away from subclassing from ``unittest.TestCase``
to *plain asserts* and the benefits from the full pytest feature set.