zope.pytestlayer 8.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- zope.pytestlayer-8.2/.pre-commit-config.yaml +46 -0
- zope.pytestlayer-8.2/.readthedocs.yaml +25 -0
- zope.pytestlayer-8.2/CHANGES.rst +154 -0
- zope.pytestlayer-8.2/CONTRIBUTING.md +23 -0
- zope.pytestlayer-8.2/COPYRIGHT.txt +10 -0
- zope.pytestlayer-8.2/HACKING.rst +19 -0
- zope.pytestlayer-8.2/LICENSE.txt +43 -0
- zope.pytestlayer-8.2/MANIFEST.in +17 -0
- zope.pytestlayer-8.2/PKG-INFO +318 -0
- zope.pytestlayer-8.2/README.rst +97 -0
- zope.pytestlayer-8.2/buildout.cfg +48 -0
- zope.pytestlayer-8.2/docs/about.rst +3 -0
- zope.pytestlayer-8.2/docs/api.rst +8 -0
- zope.pytestlayer-8.2/docs/changes.rst +1 -0
- zope.pytestlayer-8.2/docs/conf.py +11 -0
- zope.pytestlayer-8.2/docs/index.rst +11 -0
- zope.pytestlayer-8.2/pytest.ini +11 -0
- zope.pytestlayer-8.2/setup.cfg +26 -0
- zope.pytestlayer-8.2/setup.py +77 -0
- zope.pytestlayer-8.2/src/zope/__init__.py +1 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/__init__.py +0 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/_compat.py +18 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/doctest.py +31 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/fixture.py +234 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/layered.py +100 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/plugin.py +122 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/testing.py +6 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/__init__.py +0 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/conftest.py +3 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/bad_layer/__init__.py +0 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/bad_layer/conftest.py +1 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/bad_layer/test_core.py +13 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/custom_fixture_name/__init__.py +0 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/custom_fixture_name/conftest.py +12 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/custom_fixture_name/test_core.py +38 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/keep_layer_across_test_classes/__init__.py +0 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/keep_layer_across_test_classes/conftest.py +1 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/keep_layer_across_test_classes/test_core.py +101 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/layers_with_same_name/__init__.py +0 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/layers_with_same_name/conftest.py +1 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/layers_with_same_name/test_core.py +40 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/no_setup_or_teardown/__init__.py +0 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/no_setup_or_teardown/conftest.py +1 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/no_setup_or_teardown/test_core.py +14 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/order_by_layer/__init__.py +0 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/order_by_layer/conftest.py +1 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/order_by_layer/test_core.py +112 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/order_with_layered_suite/__init__.py +0 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/order_with_layered_suite/conftest.py +1 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/order_with_layered_suite/foo.txt +14 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/order_with_layered_suite/foobar.txt +14 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py +139 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/session_fixture/__init__.py +0 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/session_fixture/conftest.py +13 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/session_fixture/test_core.py +37 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/shared_with_layered_suite/__init__.py +0 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/shared_with_layered_suite/conftest.py +1 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/shared_with_layered_suite/mydoctest.txt +10 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/shared_with_layered_suite/test_core.py +53 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/single_layer/__init__.py +0 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/single_layer/conftest.py +1 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/single_layer/test_core.py +33 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/single_layer_in_two_modules/__init__.py +0 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/single_layer_in_two_modules/conftest.py +1 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/single_layer_in_two_modules/test_core.py +33 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/single_layer_in_two_modules/test_second_module.py +12 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/__init__.py +0 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/conftest.py +1 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/test_core.py +54 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/single_layered_suite/__init__.py +0 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/single_layered_suite/conftest.py +1 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/single_layered_suite/doctest.txt +10 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/single_layered_suite/test_core.py +44 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/__init__.py +0 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/bar.txt +14 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/conftest.py +1 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/foo.txt +14 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/test_core.py +72 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/two_dependent_layers/__init__.py +0 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/two_dependent_layers/conftest.py +1 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/two_dependent_layers/test_core.py +67 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/two_independent_layers/__init__.py +0 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/two_independent_layers/conftest.py +1 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/two_independent_layers/test_core.py +67 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/with_and_without_layer/__init__.py +0 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/with_and_without_layer/conftest.py +1 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/fixture/with_and_without_layer/test_core.py +39 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/test_doctest.py +16 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/test_fixture.py +17 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/test_integration.py +524 -0
- zope.pytestlayer-8.2/src/zope/pytestlayer/tests/test_layer.py +13 -0
- zope.pytestlayer-8.2/src/zope.pytestlayer.egg-info/PKG-INFO +318 -0
- zope.pytestlayer-8.2/src/zope.pytestlayer.egg-info/SOURCES.txt +99 -0
- zope.pytestlayer-8.2/src/zope.pytestlayer.egg-info/dependency_links.txt +1 -0
- zope.pytestlayer-8.2/src/zope.pytestlayer.egg-info/entry_points.txt +2 -0
- zope.pytestlayer-8.2/src/zope.pytestlayer.egg-info/namespace_packages.txt +1 -0
- zope.pytestlayer-8.2/src/zope.pytestlayer.egg-info/not-zip-safe +1 -0
- zope.pytestlayer-8.2/src/zope.pytestlayer.egg-info/requires.txt +10 -0
- zope.pytestlayer-8.2/src/zope.pytestlayer.egg-info/top_level.txt +1 -0
- zope.pytestlayer-8.2/tox.ini +109 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
repos:
|
|
3
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
4
|
+
rev: v4.5.0
|
|
5
|
+
hooks:
|
|
6
|
+
- id: trailing-whitespace
|
|
7
|
+
- id: end-of-file-fixer
|
|
8
|
+
- id: fix-encoding-pragma
|
|
9
|
+
args: [--remove]
|
|
10
|
+
- id: check-yaml
|
|
11
|
+
- id: debug-statements
|
|
12
|
+
language_version: python3
|
|
13
|
+
- repo: https://github.com/PyCQA/flake8
|
|
14
|
+
rev: 6.1.0
|
|
15
|
+
hooks:
|
|
16
|
+
- id: flake8
|
|
17
|
+
language_version: python3
|
|
18
|
+
additional_dependencies: [flake8-typing-imports==1.14.0]
|
|
19
|
+
args: ["--per-file-ignores=src/zope/pytestlayer/tests/test_integration.py:E501"]
|
|
20
|
+
- repo: https://github.com/hhatto/autopep8
|
|
21
|
+
rev: v2.0.4
|
|
22
|
+
hooks:
|
|
23
|
+
- id: autopep8
|
|
24
|
+
- repo: https://github.com/PyCQA/isort
|
|
25
|
+
rev: 5.12.0
|
|
26
|
+
hooks:
|
|
27
|
+
- id: isort
|
|
28
|
+
args: [--filter-files]
|
|
29
|
+
files: \.py$
|
|
30
|
+
- repo: local
|
|
31
|
+
hooks:
|
|
32
|
+
- id: rst
|
|
33
|
+
name: rst
|
|
34
|
+
entry: rst-lint --encoding utf-8
|
|
35
|
+
exclude: ./doc/*
|
|
36
|
+
# We have Sphinx directives in the docs. This cannot be validated
|
|
37
|
+
# here. We therefore include two rst-linter. They complement each
|
|
38
|
+
# other. This regex matches all *.rst not in the doc/ folder.
|
|
39
|
+
files: ^[^(doc)].*rst
|
|
40
|
+
language: python
|
|
41
|
+
additional_dependencies: [pygments, restructuredtext_lint]
|
|
42
|
+
- repo: https://github.com/rstcheck/rstcheck
|
|
43
|
+
rev: 'v6.2.0'
|
|
44
|
+
hooks:
|
|
45
|
+
- id: rstcheck
|
|
46
|
+
args: ["--ignore-messages", 'No directive entry for "autosummary"|No role entry for "ref"|Unknown interpreted text role "ref"|Unknown directive type "(autosummary|literalinclude|toctree)"']
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Generated from:
|
|
2
|
+
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
|
|
3
|
+
# Read the Docs configuration file
|
|
4
|
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
5
|
+
|
|
6
|
+
# Required
|
|
7
|
+
version: 2
|
|
8
|
+
|
|
9
|
+
# Set the version of Python and other tools you might need
|
|
10
|
+
build:
|
|
11
|
+
os: ubuntu-22.04
|
|
12
|
+
tools:
|
|
13
|
+
python: "3.11"
|
|
14
|
+
|
|
15
|
+
# Build documentation in the docs/ directory with Sphinx
|
|
16
|
+
sphinx:
|
|
17
|
+
configuration: docs/conf.py
|
|
18
|
+
|
|
19
|
+
# We recommend specifying your dependencies to enable reproducible builds:
|
|
20
|
+
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
|
|
21
|
+
python:
|
|
22
|
+
install:
|
|
23
|
+
- requirements: docs/requirements.txt
|
|
24
|
+
- method: pip
|
|
25
|
+
path: .
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
=================================
|
|
2
|
+
Change log for zope.pytestlayer
|
|
3
|
+
=================================
|
|
4
|
+
|
|
5
|
+
8.2 (2024-05-15)
|
|
6
|
+
================
|
|
7
|
+
|
|
8
|
+
- Make tests compatible with pytest >= 7.3. (Caution: We do not yet support
|
|
9
|
+
pytest >= 8)
|
|
10
|
+
|
|
11
|
+
- Add support for Python 3.11.
|
|
12
|
+
|
|
13
|
+
- Add support for Python 3.12.
|
|
14
|
+
|
|
15
|
+
- Rename from ``gocept.pytestlayer`` to ``zope.pytestlayer``.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
8.1 (2022-09-05)
|
|
19
|
+
================
|
|
20
|
+
|
|
21
|
+
- Ensure compatibility with pytest >= 7.1.3.
|
|
22
|
+
``.layered.LayeredTestCaseInstance`` now has to inherit from
|
|
23
|
+
``_pytest.unittest.UnitTestCase``.
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
8.0 (2021-12-13)
|
|
27
|
+
================
|
|
28
|
+
|
|
29
|
+
- Use GitHub actions as CI.
|
|
30
|
+
|
|
31
|
+
- Add support for Python 3.9 and 3.10.
|
|
32
|
+
|
|
33
|
+
- Drop support for Python 3.6.
|
|
34
|
+
|
|
35
|
+
- Add a workaround for
|
|
36
|
+
`#4 <https://github.com/gocept/gocept.pytestlayer/issues/4>`_: Use
|
|
37
|
+
``gcoept.pytestlayer.doctest.DocTestSuite`` instead of
|
|
38
|
+
``doctest.DocTestSuite`` to circumvent the issue.
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
7.0 (2020-08-03)
|
|
42
|
+
================
|
|
43
|
+
|
|
44
|
+
Backwards imcompatible changes
|
|
45
|
+
------------------------------
|
|
46
|
+
|
|
47
|
+
- Drop support for Python 2.7 and 3.5 and ``pytest < 5.0``. (#8)
|
|
48
|
+
|
|
49
|
+
Features
|
|
50
|
+
--------
|
|
51
|
+
|
|
52
|
+
- Support ``pytest >= 6.0``. (#8)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
6.3 (2020-05-15)
|
|
56
|
+
================
|
|
57
|
+
|
|
58
|
+
- Ensure compatibility with pytest > 5.4.2. We need a
|
|
59
|
+
``_explicit_tearDown`` on our ``LayeredTestCaseFunction`` now.
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
6.2 (2020-03-20)
|
|
63
|
+
================
|
|
64
|
+
|
|
65
|
+
- Ensure compatibility with pytest > 5.4. We need a
|
|
66
|
+
``_needs_explicit_tearDown`` on our ``LayeredTestCaseFunction`` now.
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
6.1 (2020-02-20)
|
|
70
|
+
================
|
|
71
|
+
|
|
72
|
+
- Fix tests to run with `pytest >= 4.2.0`.
|
|
73
|
+
|
|
74
|
+
- Migrate to Github.
|
|
75
|
+
|
|
76
|
+
- Do not break when rerunning a doctest using `pytest-rerunfailures`.
|
|
77
|
+
|
|
78
|
+
- Add support for Python 3.8.
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
6.0 (2018-10-24)
|
|
82
|
+
================
|
|
83
|
+
|
|
84
|
+
- Add support for Python 3.6, 3.7 and PyPy3.
|
|
85
|
+
|
|
86
|
+
- Drop support for Python 3.4.
|
|
87
|
+
|
|
88
|
+
- Fix tests to run with `pytest >= 3.9.1`.
|
|
89
|
+
|
|
90
|
+
- Release also as universal wheel.
|
|
91
|
+
|
|
92
|
+
- Update to new pytest fixture API to avoid DeprecationWarnings. (#10)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
5.1 (2016-12-02)
|
|
96
|
+
================
|
|
97
|
+
|
|
98
|
+
- Make installation process compatible with `setuptools >= 30.0`.
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
5.0 (2016-08-23)
|
|
102
|
+
================
|
|
103
|
+
|
|
104
|
+
- Fix tests to pass if `pytest >= 3.0` is used for testing.
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
4.0 (2016-04-27)
|
|
108
|
+
================
|
|
109
|
+
|
|
110
|
+
- Support Python 3.4, 3.5 and PyPy.
|
|
111
|
+
|
|
112
|
+
- Use tox as testrunner.
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
3.0 (2016-04-14)
|
|
116
|
+
================
|
|
117
|
+
|
|
118
|
+
- Claim compatibility with py.test 2.9.x.
|
|
119
|
+
|
|
120
|
+
- Drop Python 2.6 support.
|
|
121
|
+
|
|
122
|
+
2.1 (2014-10-22)
|
|
123
|
+
================
|
|
124
|
+
|
|
125
|
+
- Update handling of keywords and doctest testnames for py.test-2.5.
|
|
126
|
+
[wosc]
|
|
127
|
+
|
|
128
|
+
- Re-introduce ``gocept.pytestlayer.fixture.create()`` method, to allow giving
|
|
129
|
+
created fixtures a non-random name, so other fixtures can depend on them.
|
|
130
|
+
[tlotze, wosc]
|
|
131
|
+
|
|
132
|
+
- Generate session-scoped fixtures from layers in addition to class-scoped
|
|
133
|
+
ones, if a session-scoped one is required somewhere, the class-scoped ones
|
|
134
|
+
are simply ignored. [tlotze, wosc]
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
2.0 (2013-09-19)
|
|
138
|
+
================
|
|
139
|
+
|
|
140
|
+
- Remove need to explicitely create fixtures.
|
|
141
|
+
[gotcha]
|
|
142
|
+
|
|
143
|
+
- Add ``plone.testing.layered`` test suites support.
|
|
144
|
+
[gotcha]
|
|
145
|
+
|
|
146
|
+
- Made tests a bit more robust.
|
|
147
|
+
[icemac]
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
1.0 (2013-08-28)
|
|
151
|
+
================
|
|
152
|
+
|
|
153
|
+
- Initial release.
|
|
154
|
+
[tlotze, icemac, gotcha]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Generated from:
|
|
3
|
+
https://github.com/zopefoundation/meta/tree/master/config/pure-python
|
|
4
|
+
-->
|
|
5
|
+
# Contributing to zopefoundation projects
|
|
6
|
+
|
|
7
|
+
The projects under the zopefoundation GitHub organization are open source and
|
|
8
|
+
welcome contributions in different forms:
|
|
9
|
+
|
|
10
|
+
* bug reports
|
|
11
|
+
* code improvements and bug fixes
|
|
12
|
+
* documentation improvements
|
|
13
|
+
* pull request reviews
|
|
14
|
+
|
|
15
|
+
For any changes in the repository besides trivial typo fixes you are required
|
|
16
|
+
to sign the contributor agreement. See
|
|
17
|
+
https://www.zope.dev/developer/becoming-a-committer.html for details.
|
|
18
|
+
|
|
19
|
+
Please visit our [Developer
|
|
20
|
+
Guidelines](https://www.zope.dev/developer/guidelines.html) if you'd like to
|
|
21
|
+
contribute code changes and our [guidelines for reporting
|
|
22
|
+
bugs](https://www.zope.dev/developer/reporting-bugs.html) if you want to file a
|
|
23
|
+
bug report.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Copyright (c) 2013-2016, 2021 gocept gmbh & co. kg
|
|
2
|
+
Copyright (c) 2024 Zope Foundation and contributors
|
|
3
|
+
All Rights Reserved.
|
|
4
|
+
|
|
5
|
+
This software is subject to the provisions of the Zope Public License,
|
|
6
|
+
Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
|
|
7
|
+
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
|
|
8
|
+
WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
9
|
+
WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
|
|
10
|
+
FOR A PARTICULAR PURPOSE.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
===========================
|
|
2
|
+
Developing zope.pytestlayer
|
|
3
|
+
===========================
|
|
4
|
+
|
|
5
|
+
:Author:
|
|
6
|
+
gocept,
|
|
7
|
+
Godefroid Chapelle <gotcha@bubblenet.be>
|
|
8
|
+
|
|
9
|
+
:PyPI page:
|
|
10
|
+
https://pypi.org/project/zope.pytestlayer/
|
|
11
|
+
|
|
12
|
+
:Issues:
|
|
13
|
+
https://github.com/zopefoundation/zope.pytestlayer/issues
|
|
14
|
+
|
|
15
|
+
:Source code:
|
|
16
|
+
https://github.com/zopefoundation/zope.pytestlayer
|
|
17
|
+
|
|
18
|
+
:Current change log:
|
|
19
|
+
https://raw.githubusercontent.com/zopefoundation/zope.pytestlayer/master/CHANGES.rst
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
Zope Public License (ZPL) Version 2.1
|
|
2
|
+
|
|
3
|
+
A copyright notice accompanies this license document that identifies the
|
|
4
|
+
copyright holders.
|
|
5
|
+
|
|
6
|
+
This license has been certified as open source. It has also been designated as
|
|
7
|
+
GPL compatible by the Free Software Foundation (FSF).
|
|
8
|
+
|
|
9
|
+
Redistribution and use in source and binary forms, with or without
|
|
10
|
+
modification, are permitted provided that the following conditions are met:
|
|
11
|
+
|
|
12
|
+
1. Redistributions in source code must retain the accompanying copyright
|
|
13
|
+
notice, this list of conditions, and the following disclaimer.
|
|
14
|
+
|
|
15
|
+
2. Redistributions in binary form must reproduce the accompanying copyright
|
|
16
|
+
notice, this list of conditions, and the following disclaimer in the
|
|
17
|
+
documentation and/or other materials provided with the distribution.
|
|
18
|
+
|
|
19
|
+
3. Names of the copyright holders must not be used to endorse or promote
|
|
20
|
+
products derived from this software without prior written permission from the
|
|
21
|
+
copyright holders.
|
|
22
|
+
|
|
23
|
+
4. The right to distribute this software or to use it for any purpose does not
|
|
24
|
+
give you the right to use Servicemarks (sm) or Trademarks (tm) of the copyright
|
|
25
|
+
holders. Use of them is covered by separate agreement with the copyright
|
|
26
|
+
holders.
|
|
27
|
+
|
|
28
|
+
5. If any files are modified, you must cause the modified files to carry
|
|
29
|
+
prominent notices stating that you changed the files and the date of any
|
|
30
|
+
change.
|
|
31
|
+
|
|
32
|
+
Disclaimer
|
|
33
|
+
|
|
34
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
|
35
|
+
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
36
|
+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
37
|
+
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
38
|
+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
39
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
40
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
41
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
42
|
+
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
43
|
+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Generated from:
|
|
2
|
+
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
|
|
3
|
+
include *.md
|
|
4
|
+
include *.rst
|
|
5
|
+
include *.txt
|
|
6
|
+
include buildout.cfg
|
|
7
|
+
include tox.ini
|
|
8
|
+
|
|
9
|
+
recursive-include docs *.py
|
|
10
|
+
recursive-include docs *.rst
|
|
11
|
+
recursive-include docs *.txt
|
|
12
|
+
recursive-include docs Makefile
|
|
13
|
+
|
|
14
|
+
recursive-include src *.py
|
|
15
|
+
include *.yaml
|
|
16
|
+
include pytest.ini
|
|
17
|
+
recursive-include src *.txt
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: zope.pytestlayer
|
|
3
|
+
Version: 8.2
|
|
4
|
+
Summary: Integration of zope.testrunner-style test layers into pytest framework
|
|
5
|
+
Home-page: https://github.com/zopefoundation/zope.pytestlayer/
|
|
6
|
+
Author: gocept
|
|
7
|
+
Author-email: zope-dev@zope.dev
|
|
8
|
+
License: ZPL 2.1
|
|
9
|
+
Keywords: pytest zope.testrunner layer fixture
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Framework :: Pytest
|
|
13
|
+
Classifier: Framework :: Plone
|
|
14
|
+
Classifier: Framework :: Zope :: 3
|
|
15
|
+
Classifier: Framework :: Zope :: 5
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: License :: OSI Approved :: Zope Public License
|
|
18
|
+
Classifier: Natural Language :: English
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
27
|
+
Classifier: Programming Language :: Python :: Implementation
|
|
28
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
29
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
30
|
+
Classifier: Topic :: Software Development
|
|
31
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
32
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
33
|
+
Classifier: Topic :: Software Development :: Testing
|
|
34
|
+
Requires-Python: >=3.7
|
|
35
|
+
License-File: LICENSE.txt
|
|
36
|
+
Requires-Dist: pytest<8,>=6
|
|
37
|
+
Requires-Dist: setuptools
|
|
38
|
+
Requires-Dist: zope.dottedname
|
|
39
|
+
Provides-Extra: test
|
|
40
|
+
Requires-Dist: plone.testing; extra == "test"
|
|
41
|
+
Provides-Extra: docs
|
|
42
|
+
Requires-Dist: Sphinx; extra == "docs"
|
|
43
|
+
Requires-Dist: gocept.package; extra == "docs"
|
|
44
|
+
|
|
45
|
+
=================================
|
|
46
|
+
The zope.pytestlayer distribution
|
|
47
|
+
=================================
|
|
48
|
+
|
|
49
|
+
.. image:: https://img.shields.io/pypi/v/zope.pytestlayer.svg
|
|
50
|
+
:target: https://pypi.org/project/zope.pytestlayer/
|
|
51
|
+
|
|
52
|
+
.. image:: https://img.shields.io/pypi/pyversions/zope.pytestlayer.svg
|
|
53
|
+
:target: https://pypi.org/project/zope.pytestlayer/
|
|
54
|
+
|
|
55
|
+
.. image:: https://github.com/zopefoundation/zope.pytestlayer/actions/workflows/tests.yml/badge.svg
|
|
56
|
+
:target: https://github.com/zopefoundation/zope.pytestlayer/actions?query=tests
|
|
57
|
+
|
|
58
|
+
.. image:: https://coveralls.io/repos/github/zope/zope.pytestlayer/badge.svg?branch=master
|
|
59
|
+
:target: https://coveralls.io/github/zope/zope.pytestlayer?branch=master
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
Integration of zope.testrunner-style test layers into the `pytest`_
|
|
63
|
+
framework
|
|
64
|
+
|
|
65
|
+
This package is compatible with Python versions 3.7 - 3.12 including
|
|
66
|
+
PyPy3.
|
|
67
|
+
|
|
68
|
+
It was formerly known as ``gocept.pytestlayer``.
|
|
69
|
+
|
|
70
|
+
.. _`pytest` : http://pytest.org
|
|
71
|
+
|
|
72
|
+
Quick start
|
|
73
|
+
===========
|
|
74
|
+
|
|
75
|
+
* Make sure your test files follow the `conventions of pytest's test
|
|
76
|
+
discovery`_
|
|
77
|
+
|
|
78
|
+
.. _`conventions of pytest's test discovery`:
|
|
79
|
+
http://pytest.org/latest/goodpractises.html#python-test-discovery
|
|
80
|
+
|
|
81
|
+
In particular, a file named ``tests.py`` will not be recognized.
|
|
82
|
+
|
|
83
|
+
* Add a buildout section to create the `pytest` runner::
|
|
84
|
+
|
|
85
|
+
[buildout]
|
|
86
|
+
parts += pytest
|
|
87
|
+
|
|
88
|
+
[pytest]
|
|
89
|
+
recipe = zc.recipe.egg
|
|
90
|
+
eggs = zope.pytestlayer
|
|
91
|
+
pytest
|
|
92
|
+
<YOUR PACKAGE HERE>
|
|
93
|
+
|
|
94
|
+
``zope.pytestlayer`` registers itself as a ``pytest`` plugin. This way, nothing
|
|
95
|
+
more is needed to run an existing Zope or Plone test suite.
|
|
96
|
+
|
|
97
|
+
Advanced usage
|
|
98
|
+
==============
|
|
99
|
+
|
|
100
|
+
Version 2.1 reintroduced `fixture.create()` to be able to define the name of
|
|
101
|
+
the generated to pytest fixtures. So it is possible to use them in function
|
|
102
|
+
style tests.
|
|
103
|
+
|
|
104
|
+
Example (Code has to be in `contest.py`!)::
|
|
105
|
+
|
|
106
|
+
from .testing import FUNCTIONAL_LAYER
|
|
107
|
+
import zope.pytestlayer.fixture
|
|
108
|
+
|
|
109
|
+
globals().update(zope.pytestlayer.fixture.create(
|
|
110
|
+
FUNCTIONAL_LAYER,
|
|
111
|
+
session_fixture_name='functional_session',
|
|
112
|
+
class_fixture_name='functional_class',
|
|
113
|
+
function_fixture_name='functional'))
|
|
114
|
+
|
|
115
|
+
This creates three fixtures with the given names and the scopes in the argument
|
|
116
|
+
name. The session and class fixtures run `setUp()` and `tearDown()` of the
|
|
117
|
+
layer if it has not been run before while the function fixture runs
|
|
118
|
+
`testSetUp()` and `testTearDown()` of the layer. The function fixture depends
|
|
119
|
+
on the session one. The fixtures return the instance of the layer. So you can
|
|
120
|
+
use the `functional` fixture like this::
|
|
121
|
+
|
|
122
|
+
def test_mymodule__my_function__1(functional):
|
|
123
|
+
assert functional['app'] is not None
|
|
124
|
+
|
|
125
|
+
Not supported use cases
|
|
126
|
+
=======================
|
|
127
|
+
|
|
128
|
+
* Inheriting from a base class while changing the layer. See commit `f879f9e
|
|
129
|
+
<https://github.com/zope/zope.pytestlayer/commit/f879f9eb21cbd41a843b5021bc1264e9462fb505>`_.
|
|
130
|
+
|
|
131
|
+
* Mixing classes inheriting ``unittest.TestCase`` and a ``test_suite()``
|
|
132
|
+
function (e. g. to create a ``DocTestSuite`` or a ``DocFileSuite``) in a
|
|
133
|
+
single module (aka file).
|
|
134
|
+
|
|
135
|
+
* This is a limitation of the `pytest` test discovery which ignores the
|
|
136
|
+
doctests in this case.
|
|
137
|
+
|
|
138
|
+
* Solution: Put the classes and ``test_suite()`` into different modules.
|
|
139
|
+
|
|
140
|
+
* A ``doctest.DocFileSuite`` which does not have a ``layer`` is silently
|
|
141
|
+
skipped. Use the built-in doctest abilities of pytest to run those tests.
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
===========================
|
|
145
|
+
Developing zope.pytestlayer
|
|
146
|
+
===========================
|
|
147
|
+
|
|
148
|
+
:Author:
|
|
149
|
+
gocept,
|
|
150
|
+
Godefroid Chapelle <gotcha@bubblenet.be>
|
|
151
|
+
|
|
152
|
+
:PyPI page:
|
|
153
|
+
https://pypi.org/project/zope.pytestlayer/
|
|
154
|
+
|
|
155
|
+
:Issues:
|
|
156
|
+
https://github.com/zopefoundation/zope.pytestlayer/issues
|
|
157
|
+
|
|
158
|
+
:Source code:
|
|
159
|
+
https://github.com/zopefoundation/zope.pytestlayer
|
|
160
|
+
|
|
161
|
+
:Current change log:
|
|
162
|
+
https://raw.githubusercontent.com/zopefoundation/zope.pytestlayer/master/CHANGES.rst
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
=================================
|
|
166
|
+
Change log for zope.pytestlayer
|
|
167
|
+
=================================
|
|
168
|
+
|
|
169
|
+
8.2 (2024-05-15)
|
|
170
|
+
================
|
|
171
|
+
|
|
172
|
+
- Make tests compatible with pytest >= 7.3. (Caution: We do not yet support
|
|
173
|
+
pytest >= 8)
|
|
174
|
+
|
|
175
|
+
- Add support for Python 3.11.
|
|
176
|
+
|
|
177
|
+
- Add support for Python 3.12.
|
|
178
|
+
|
|
179
|
+
- Rename from ``gocept.pytestlayer`` to ``zope.pytestlayer``.
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
8.1 (2022-09-05)
|
|
183
|
+
================
|
|
184
|
+
|
|
185
|
+
- Ensure compatibility with pytest >= 7.1.3.
|
|
186
|
+
``.layered.LayeredTestCaseInstance`` now has to inherit from
|
|
187
|
+
``_pytest.unittest.UnitTestCase``.
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
8.0 (2021-12-13)
|
|
191
|
+
================
|
|
192
|
+
|
|
193
|
+
- Use GitHub actions as CI.
|
|
194
|
+
|
|
195
|
+
- Add support for Python 3.9 and 3.10.
|
|
196
|
+
|
|
197
|
+
- Drop support for Python 3.6.
|
|
198
|
+
|
|
199
|
+
- Add a workaround for
|
|
200
|
+
`#4 <https://github.com/gocept/gocept.pytestlayer/issues/4>`_: Use
|
|
201
|
+
``gcoept.pytestlayer.doctest.DocTestSuite`` instead of
|
|
202
|
+
``doctest.DocTestSuite`` to circumvent the issue.
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
7.0 (2020-08-03)
|
|
206
|
+
================
|
|
207
|
+
|
|
208
|
+
Backwards imcompatible changes
|
|
209
|
+
------------------------------
|
|
210
|
+
|
|
211
|
+
- Drop support for Python 2.7 and 3.5 and ``pytest < 5.0``. (#8)
|
|
212
|
+
|
|
213
|
+
Features
|
|
214
|
+
--------
|
|
215
|
+
|
|
216
|
+
- Support ``pytest >= 6.0``. (#8)
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
6.3 (2020-05-15)
|
|
220
|
+
================
|
|
221
|
+
|
|
222
|
+
- Ensure compatibility with pytest > 5.4.2. We need a
|
|
223
|
+
``_explicit_tearDown`` on our ``LayeredTestCaseFunction`` now.
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
6.2 (2020-03-20)
|
|
227
|
+
================
|
|
228
|
+
|
|
229
|
+
- Ensure compatibility with pytest > 5.4. We need a
|
|
230
|
+
``_needs_explicit_tearDown`` on our ``LayeredTestCaseFunction`` now.
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
6.1 (2020-02-20)
|
|
234
|
+
================
|
|
235
|
+
|
|
236
|
+
- Fix tests to run with `pytest >= 4.2.0`.
|
|
237
|
+
|
|
238
|
+
- Migrate to Github.
|
|
239
|
+
|
|
240
|
+
- Do not break when rerunning a doctest using `pytest-rerunfailures`.
|
|
241
|
+
|
|
242
|
+
- Add support for Python 3.8.
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
6.0 (2018-10-24)
|
|
246
|
+
================
|
|
247
|
+
|
|
248
|
+
- Add support for Python 3.6, 3.7 and PyPy3.
|
|
249
|
+
|
|
250
|
+
- Drop support for Python 3.4.
|
|
251
|
+
|
|
252
|
+
- Fix tests to run with `pytest >= 3.9.1`.
|
|
253
|
+
|
|
254
|
+
- Release also as universal wheel.
|
|
255
|
+
|
|
256
|
+
- Update to new pytest fixture API to avoid DeprecationWarnings. (#10)
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
5.1 (2016-12-02)
|
|
260
|
+
================
|
|
261
|
+
|
|
262
|
+
- Make installation process compatible with `setuptools >= 30.0`.
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
5.0 (2016-08-23)
|
|
266
|
+
================
|
|
267
|
+
|
|
268
|
+
- Fix tests to pass if `pytest >= 3.0` is used for testing.
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
4.0 (2016-04-27)
|
|
272
|
+
================
|
|
273
|
+
|
|
274
|
+
- Support Python 3.4, 3.5 and PyPy.
|
|
275
|
+
|
|
276
|
+
- Use tox as testrunner.
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
3.0 (2016-04-14)
|
|
280
|
+
================
|
|
281
|
+
|
|
282
|
+
- Claim compatibility with py.test 2.9.x.
|
|
283
|
+
|
|
284
|
+
- Drop Python 2.6 support.
|
|
285
|
+
|
|
286
|
+
2.1 (2014-10-22)
|
|
287
|
+
================
|
|
288
|
+
|
|
289
|
+
- Update handling of keywords and doctest testnames for py.test-2.5.
|
|
290
|
+
[wosc]
|
|
291
|
+
|
|
292
|
+
- Re-introduce ``gocept.pytestlayer.fixture.create()`` method, to allow giving
|
|
293
|
+
created fixtures a non-random name, so other fixtures can depend on them.
|
|
294
|
+
[tlotze, wosc]
|
|
295
|
+
|
|
296
|
+
- Generate session-scoped fixtures from layers in addition to class-scoped
|
|
297
|
+
ones, if a session-scoped one is required somewhere, the class-scoped ones
|
|
298
|
+
are simply ignored. [tlotze, wosc]
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
2.0 (2013-09-19)
|
|
302
|
+
================
|
|
303
|
+
|
|
304
|
+
- Remove need to explicitely create fixtures.
|
|
305
|
+
[gotcha]
|
|
306
|
+
|
|
307
|
+
- Add ``plone.testing.layered`` test suites support.
|
|
308
|
+
[gotcha]
|
|
309
|
+
|
|
310
|
+
- Made tests a bit more robust.
|
|
311
|
+
[icemac]
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
1.0 (2013-08-28)
|
|
315
|
+
================
|
|
316
|
+
|
|
317
|
+
- Initial release.
|
|
318
|
+
[tlotze, icemac, gotcha]
|