From 0498e888fc5476e90a1356f1ade86a8a87742c42 Mon Sep 17 00:00:00 2001 From: Rolf Krahl Date: Mon, 27 Nov 2017 19:51:49 +0100 Subject: [PATCH 1/7] Fix wrong link. --- doc/src/usage.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/usage.rst b/doc/src/usage.rst index 9755c9b..39548f0 100644 --- a/doc/src/usage.rst +++ b/doc/src/usage.rst @@ -51,8 +51,6 @@ set: .. literalinclude:: ../examples/named.py -.. _usage-parametrized: - Using test classes ------------------ @@ -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 ------------------ From 1ccafefce9db9dc77cf42af6b56435590698fae2 Mon Sep 17 00:00:00 2001 From: Rolf Krahl Date: Mon, 27 Nov 2017 20:17:17 +0100 Subject: [PATCH 2/7] Fix: must exclude .travis.yml from generating python2_6.patch. --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e753388..d472501 100644 --- a/Makefile +++ b/Makefile @@ -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 From 5c566a5bc2252d1ad334d62dcb5cb95ed609ddfe Mon Sep 17 00:00:00 2001 From: Rolf Krahl Date: Sat, 2 Dec 2017 13:01:32 +0100 Subject: [PATCH 3/7] Formulation details in the documentation. --- doc/src/advanced.rst | 11 ++++++----- doc/src/usage.rst | 14 ++++++++++---- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/doc/src/advanced.rst b/doc/src/advanced.rst index 8279c60..fd572e1 100644 --- a/doc/src/advanced.rst +++ b/doc/src/advanced.rst @@ -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 ----------------------------- diff --git a/doc/src/usage.rst b/doc/src/usage.rst index 39548f0..a341d08 100644 --- a/doc/src/usage.rst +++ b/doc/src/usage.rst @@ -44,10 +44,10 @@ 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 @@ -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`. From 65f1bb9d212f016afd51686f70a4480a54843f6c Mon Sep 17 00:00:00 2001 From: Rolf Krahl Date: Sat, 2 Dec 2017 15:11:57 +0100 Subject: [PATCH 4/7] Add a page on configuration. --- doc/src/configuration.rst | 16 ++++++++++++++++ doc/src/index.rst | 1 + 2 files changed, 17 insertions(+) create mode 100644 doc/src/configuration.rst diff --git a/doc/src/configuration.rst b/doc/src/configuration.rst new file mode 100644 index 0000000..f93a8d6 --- /dev/null +++ b/doc/src/configuration.rst @@ -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. diff --git a/doc/src/index.rst b/doc/src/index.rst index d49639b..9358ffd 100644 --- a/doc/src/index.rst +++ b/doc/src/index.rst @@ -15,4 +15,5 @@ Content of the documentation install usage advanced + configuration reference From 2934f266f5016ff75bc321bebded26c07a3dc1a3 Mon Sep 17 00:00:00 2001 From: Rolf Krahl Date: Sun, 3 Dec 2017 13:30:45 +0100 Subject: [PATCH 5/7] Disable progress output style in embedded tests. Fixes #15. --- tests/conftest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index d35c873..26cdc0b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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: From 578c986d5d3cbea4613b66137e7146404565e4ff Mon Sep 17 00:00:00 2001 From: Rolf Krahl Date: Sun, 3 Dec 2017 13:38:08 +0100 Subject: [PATCH 6/7] Update CHANGES --- CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index dd5186e..d30a7d3 100644 --- a/CHANGES +++ b/CHANGES @@ -44,6 +44,8 @@ + Issue #13: Do not import pytest in setup.py to make it compatible with pipenv. + + Issue #15: tests fail with pytest 3.3.0. + * Version 0.2 (2017-05-28) ** New features From af9a84a222bfcf4fb38300317a9541ce39b7529e Mon Sep 17 00:00:00 2001 From: Rolf Krahl Date: Sun, 3 Dec 2017 15:54:23 +0100 Subject: [PATCH 7/7] Clarify that Python 3.1 is not supported. --- CHANGES | 4 ++++ README.rst | 14 +++----------- doc/src/install.rst | 4 +++- setup.py | 1 - 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/CHANGES b/CHANGES index dd5186e..4b2e5f2 100644 --- a/CHANGES +++ b/CHANGES @@ -44,6 +44,10 @@ + Issue #13: Do not import pytest in setup.py to make it compatible with pipenv. + + 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 diff --git a/README.rst b/README.rst index e4e3ed0..9d2cefa 100644 --- a/README.rst +++ b/README.rst @@ -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 ------------ @@ -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 --------------------- diff --git a/doc/src/install.rst b/doc/src/install.rst index 3cd8a67..082bdb9 100644 --- a/doc/src/install.rst +++ b/doc/src/install.rst @@ -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 -------- diff --git a/setup.py b/setup.py index 6d9ec6d..3bb7799 100755 --- a/setup.py +++ b/setup.py @@ -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',