Skip to content

Commit

Permalink
Merge branch 'master' into automark
Browse files Browse the repository at this point in the history
  • Loading branch information
RKrahl committed Dec 3, 2017
2 parents e9dc3cf + 5f17430 commit 523596a
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 25 deletions.
6 changes: 6 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
+ Issue #13: Do not import pytest in setup.py to make it compatible
with pipenv.

+ Issue #15: tests fail with pytest 3.3.0.

+ Clarify in the documentation that Python 3.1 is not officially
supported because pytest 2.8 does not support it. There is no
known issue with Python 3.1 though.

* Version 0.2 (2017-05-28)

** New features
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ distclean: clean
git describe --always --dirty > .gitrevision

python2_6.patch:
git diff `git merge-base master python2_6` python2_6 > $@
git diff `git merge-base master python2_6` python2_6 \
-- . ':(exclude).travis.yml' > $@


.PHONY: build test sdist doc-html doc-pdf doc-dist clean distclean .gitrevision
14 changes: 3 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ The latest release version can be found at PyPI, see
System requirements
-------------------

+ Python 2.6, 2.7, or 3.1 and newer.
+ Python 2.6, 2.7, or 3.2 and newer.
Python 2.6 requires patching the sources, see below.
+ `setuptools`_.
+ `pytest`_ 2.8.0 or newer.

(Python 3.1 is not supported by pytest 2.8.0 itself.)


Installation
------------
Expand Down Expand Up @@ -70,16 +72,6 @@ The example test modules used in the documentation can be found in
doc/examples in the source distribution.


Bugs and limitations
--------------------

+ The test fails with Python 3.1. At first glance, this looks like a
problem between pytest and Python 3.1 rather then an issue in
pytest-dependency. I didn't investigate this in detail, though. In
any case, the module can be installed and the plugin seem to work
fine also with Python 3.1.


Copyright and License
---------------------

Expand Down
11 changes: 6 additions & 5 deletions doc/src/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ Consider the following example test module:
.. literalinclude:: ../examples/dyn-parametrized.py

In principle, this example works the very same way as the basic
example for parametrized tests, see :ref:`usage-parametrized`. The
only difference is that the lists of paramters are dynamically
compiled beforehand. The test for child `l` deliberately fails, just
to show the effect. As a consequence, the test for its parent `d`
will be skipped.
example for :ref:`usage-parametrized`. The only difference is that
the lists of paramters are dynamically compiled beforehand. The test
for child `l` deliberately fails, just to show the effect. As a
consequence, the test for its parent `d` will be skipped.

.. _advanced-grouping-fixtures:

Grouping tests using fixtures
-----------------------------
Expand Down
16 changes: 16 additions & 0 deletions doc/src/configuration.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Configuring pytest-dependency
=============================

This section explains configuration options for pytest-dependency and
also other configuration that is recommended for the use with
pytest-dependency.

Configuration file options
--------------------------

Configuration file options can be set in the `ini file`.

minversion
This is a builtin configuration of pytest itself. Since
pytest-dependency requires pytest 2.8.0 or newer, it is
recommended to set this option accordingly.
1 change: 1 addition & 0 deletions doc/src/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ Content of the documentation
install
usage
advanced
configuration
reference
4 changes: 3 additions & 1 deletion doc/src/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ Installation instructions
System requirements
-------------------

+ Python 2.6, 2.7, or 3.1 and newer.
+ Python 2.6, 2.7, or 3.2 and newer.
Python 2.6 requires patching the sources, see below.
+ `setuptools`_.
+ `pytest`_ 2.8.0 or newer.

(Python 3.1 is not supported by pytest 2.8.0 itself.)


Download
--------
Expand Down
18 changes: 12 additions & 6 deletions doc/src/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,13 @@ Naming tests
Tests are referenced by their name in the `depends` argument. The
default for this name is the node ID defined by pytest, that is the
name of the test function, extended by the parameters if applicable.
As these node IDs may become complicated, the name can be overridden
by an explicit `name` argument to the marker. The following example
works exactly as the last one, only the test names are explicitely
set:
In some cases, it's not easy to predict the names of the node IDs.
For this reason, the name of the tests can be overridden by an
explicit `name` argument to the marker. The following example works
exactly as the last one, only the test names are explicitely set:

.. literalinclude:: ../examples/named.py

.. _usage-parametrized:

Using test classes
------------------

Expand All @@ -68,6 +66,8 @@ build from the name of the class and the respective method in this
case, while in `TestClassNamed` these names are overridden by an
explicit name argument to the :func:`pytest.mark.dependency` marker.

.. _usage-parametrized:

Parametrized tests
------------------

Expand Down Expand Up @@ -100,3 +100,9 @@ Tests `test_c` and `test_d` set their dependencies at runtime calling
of the `request` pytest fixture, the second argument is the list of
dependencies. It has the same effect as passing this list as the
`depends` argument to the :func:`pytest.mark.dependency` marker.

The present example is certainly somewhat artificial, as the use of
the :func:`pytest_dependency.depends` function would not be needed in
such a simple case. For a more involved example that can not as
easily be formulated with the static the `depends` argument, see
:ref:`advanced-grouping-fixtures`.
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ def make_release_tree(self, base_dir, files):
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
Expand Down
4 changes: 4 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

@pytest.fixture
def ctestdir(testdir):
testdir.makefile('.ini', pytest="""
[pytest]
console_output_style = classic
""")
testdir.makeconftest("""
import sys
if "pytest_dependency" not in sys.modules:
Expand Down

0 comments on commit 523596a

Please sign in to comment.