diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 35dbf15..0000000 --- a/.coveragerc +++ /dev/null @@ -1,10 +0,0 @@ -[run] -branch = True -source = gocept.pytestlayer - -[report] -precision = 2 -fail_under = 98 - -[html] -directory = coverage-report diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..c5508b9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,39 @@ +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/pure-python +# +# EditorConfig Configuration file, for more details see: +# http://EditorConfig.org +# EditorConfig is a convention description, that could be interpreted +# by multiple editors to enforce common coding conventions for specific +# file types + +# top-most EditorConfig file: +# Will ignore other EditorConfig files in Home directory or upper tree level. +root = true + + +[*] # For All Files +# Unix-style newlines with a newline ending every file +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +# Set default charset +charset = utf-8 +# Indent style default +indent_style = space +# Max Line Length - a hard line wrap, should be disabled +max_line_length = off + +[*.{py,cfg,ini}] +# 4 space indentation +indent_size = 4 + +[*.{yml,zpt,pt,dtml,zcml}] +# 2 space indentation +indent_size = 2 + +[{Makefile,.gitmodules}] +# Tab indentation (no size specified, but view as 4 spaces) +indent_style = tab +indent_size = unset +tab_width = unset diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 09dd6dc..7e2d1fb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,42 +1,53 @@ +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/pure-python name: tests on: push: - branches: [ main ] pull_request: - branches: [ main ] - type: [ "opened", "reopened", "synchronize" ] schedule: - cron: '0 12 * * 0' # run once a week on Sunday # Allow to run this workflow manually from the Actions tab workflow_dispatch: jobs: - tests: + build: strategy: + # We want to see all failures: + fail-fast: false matrix: + os: + - ["ubuntu", "ubuntu-latest"] config: # [Python version, tox env] - - ["3.7", "py37"] - - ["3.8", "py38"] - - ["3.9", "py39"] - - ["3.10", "py310"] - - ["pypy-3.7", "pypy3"] - - ["3.9", "coverage"] - runs-on: ubuntu-latest + - ["3.9", "release-check"] + - ["3.9", "lint"] + - ["3.7", "py37"] + - ["3.8", "py38"] + - ["3.9", "py39"] + - ["3.10", "py310"] + - ["3.11", "py311"] + - ["3.12", "py312"] + - ["pypy-3.10", "pypy3"] + - ["3.9", "docs"] + - ["3.9", "coverage"] + + runs-on: ${{ matrix.os[1] }} + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name name: ${{ matrix.config[1] }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.config[0] }} - name: Pip cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('setup.*', 'tox.ini') }} + key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }} restore-keys: | + ${{ runner.os }}-pip-${{ matrix.config[0] }}- ${{ runner.os }}-pip- - name: Install dependencies run: | @@ -47,7 +58,7 @@ jobs: - name: Coverage if: matrix.config[1] == 'coverage' run: | - pip install coveralls coverage-python-version + pip install coveralls coveralls --service=github env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 5a91ce5..1f321f5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,28 +1,32 @@ -syntax: glob - -*.egg-info +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/pure-python +*.dll +*.egg-info/ +*.profraw *.pyc -*.swp -.DS_Store -.cache +*.pyo +*.so .coverage .coverage.* +.eggs/ .installed.cfg .mr.developer.cfg -.pytest_cache/ .tox/ -__pycache__ -bin -build -coverage-report +.vscode/ +__pycache__/ +bin/ +build/ coverage.xml -develop-eggs -dist -doc/_api -eggs -include -junit-*.xml -lib -local -local.cfg -parts +develop-eggs/ +develop/ +dist/ +docs/_build +eggs/ +etc/ +lib/ +lib64 +log/ +parts/ +pyvenv.cfg +testing.log +var/ diff --git a/.meta.toml b/.meta.toml new file mode 100644 index 0000000..33c92f3 --- /dev/null +++ b/.meta.toml @@ -0,0 +1,44 @@ +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/pure-python +[meta] +template = "pure-python" +commit-id = "7713fd86" + +[python] +with-sphinx-doctests = false +with-docs = true +with-future-python = false +with-pypy = true +with-macos = false +with-windows = false + +[tox] +use-flake8 = true +testenv-commands = [ + "pytest []" +] +testenv-deps = [ + "pytest", + "pytest-cov", + "pytest-remove-stale-bytecode", +] +coverage-command = [ + "pytest --cov=src --cov-report=html []", + ] + +[coverage] +fail-under = 98 + +[flake8] +additional-config = [ + "# E501 line too long", + "per-file-ignores =", + " src/zope/pytestlayer/tests/test_integration.py: E501", + ] + +[manifest] +additional-rules = [ + "include *.yaml", + "include pytest.ini", + "recursive-include src *.txt", + ] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cb90962..3e1e621 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: - id: flake8 language_version: python3 additional_dependencies: [flake8-typing-imports==1.14.0] - args: ["--per-file-ignores=src/gocept/pytestlayer/tests/test_integration.py:E501"] + args: ["--per-file-ignores=src/zope/pytestlayer/tests/test_integration.py:E501"] - repo: https://github.com/hhatto/autopep8 rev: v2.0.4 hooks: diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..034043e --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,25 @@ +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/pure-python +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the version of Python and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/conf.py + +# We recommend specifying your dependencies to enable reproducible builds: +# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +python: + install: + - requirements: docs/requirements.txt + - method: pip + path: . diff --git a/CHANGES.rst b/CHANGES.rst index d49abd6..9791e6c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,14 +1,19 @@ ================================= -Change log for gocept.pytestlayer +Change log for zope.pytestlayer ================================= 8.2 (unreleased) ================ -- Make tests compatible with pytest >= 7.3. +- Make tests compatible with pytest >= 7.3. (Caution: We do not yet support + pytest >= 8) - Add support for Python 3.11. +- Add support for Python 3.12. + +- Rename from ``gocept.pytestlayer`` to ``zope.pytestlayer``. + 8.1 (2022-09-05) ================ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..0ab12fe --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,23 @@ + +# Contributing to zopefoundation projects + +The projects under the zopefoundation GitHub organization are open source and +welcome contributions in different forms: + +* bug reports +* code improvements and bug fixes +* documentation improvements +* pull request reviews + +For any changes in the repository besides trivial typo fixes you are required +to sign the contributor agreement. See +https://www.zope.dev/developer/becoming-a-committer.html for details. + +Please visit our [Developer +Guidelines](https://www.zope.dev/developer/guidelines.html) if you'd like to +contribute code changes and our [guidelines for reporting +bugs](https://www.zope.dev/developer/reporting-bugs.html) if you want to file a +bug report. diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt index 32ceba3..cbeb3a8 100644 --- a/COPYRIGHT.txt +++ b/COPYRIGHT.txt @@ -1,4 +1,5 @@ Copyright (c) 2013-2016, 2021 gocept gmbh & co. kg +Copyright (c) 2024 Zope Foundation and contributors All Rights Reserved. This software is subject to the provisions of the Zope Public License, diff --git a/HACKING.rst b/HACKING.rst index 387d482..b2c4362 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -1,19 +1,19 @@ -============================= -Developing gocept.pytestlayer -============================= +=========================== +Developing zope.pytestlayer +=========================== :Author: - `gocept `_ , + gocept, Godefroid Chapelle :PyPI page: - http://pypi.python.org/pypi/gocept.pytestlayer/ + https://pypi.org/project/zope.pytestlayer/ :Issues: - https://github.com/gocept/gocept.pytestlayer/issues + https://github.com/gocept/zope.pytestlayer/issues :Source code: - https://github.com/gocept/gocept.pytestlayer + https://github.com/zope/zope.pytestlayer :Current change log: - https://raw.githubusercontent.com/gocept/gocept.pytestlayer/master/CHANGES.rst + https://raw.githubusercontent.com/zope/zope.pytestlayer/master/CHANGES.rst diff --git a/MANIFEST.in b/MANIFEST.in index 75d7f3e..615039a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,12 +1,17 @@ +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/pure-python +include *.md include *.rst include *.txt -include .coveragerc include buildout.cfg -include pytest.ini include tox.ini -include *.yaml -recursive-include doc *.py -recursive-include doc *.rst +recursive-include docs *.py +recursive-include docs *.rst +recursive-include docs *.txt +recursive-include docs Makefile + recursive-include src *.py +include *.yaml +include pytest.ini recursive-include src *.txt diff --git a/README.rst b/README.rst index 9560cc7..686b4eb 100644 --- a/README.rst +++ b/README.rst @@ -1,18 +1,18 @@ -=================================== -The gocept.pytestlayer distribution -=================================== +================================= +The zope.pytestlayer distribution +================================= -.. image:: https://img.shields.io/pypi/v/gocept.pytestlayer.svg - :target: https://pypi.org/project/gocept.pytestlayer/ +.. image:: https://img.shields.io/pypi/v/zope.pytestlayer.svg + :target: https://pypi.org/project/zope.pytestlayer/ -.. image:: https://img.shields.io/pypi/pyversions/gocept.pytestlayer.svg - :target: https://pypi.org/project/gocept.pytestlayer/ +.. image:: https://img.shields.io/pypi/pyversions/zope.pytestlayer.svg + :target: https://pypi.org/project/zope.pytestlayer/ -.. image:: https://github.com/gocept/gocept.pytestlayer/workflows/tests/badge.svg - :target: https://github.com/gocept/gocept.pytestlayer/actions?query=workflow%3Atests +.. image:: https://github.com/zope/zope.pytestlayer/workflows/tests/badge.svg + :target: https://github.com/zope/zope.pytestlayer/actions?query=workflow%3Atests -.. image:: https://coveralls.io/repos/github/gocept/gocept.pytestlayer/badge.svg?branch=main - :target: https://coveralls.io/github/gocept/gocept.pytestlayer?branch=main +.. image:: https://coveralls.io/repos/github/zope/zope.pytestlayer/badge.svg?branch=master + :target: https://coveralls.io/github/zope/zope.pytestlayer?branch=master Integration of zope.testrunner-style test layers into the `pytest`_ @@ -21,6 +21,8 @@ framework This package is compatible with Python versions 3.7 - 3.11 including PyPy3. +It was formerly known as ``gocept.pytestlayer``. + .. _`pytest` : http://pytest.org Quick start @@ -32,7 +34,7 @@ Quick start .. _`conventions of pytest's test discovery`: http://pytest.org/latest/goodpractises.html#python-test-discovery - In particular, a file named ``tests.py`` will not be recognised. + In particular, a file named ``tests.py`` will not be recognized. * Add a buildout section to create the `pytest` runner:: @@ -41,30 +43,37 @@ Quick start [pytest] recipe = zc.recipe.egg - eggs = gocept.pytestlayer + eggs = zope.pytestlayer pytest -``gocept.pytestlayer`` registers itself as a ``pytest`` plugin. This way, nothing +``zope.pytestlayer`` registers itself as a ``pytest`` plugin. This way, nothing more is needed to run an existing Zope or Plone test suite. Advanced usage ============== -Version 2.1 reintroduced `fixture.create()` to be able to define the name of the generated to pytest fixtures. So it is possible to use them in function style tests. +Version 2.1 reintroduced `fixture.create()` to be able to define the name of +the generated to pytest fixtures. So it is possible to use them in function +style tests. Example (Code has to be in `contest.py`!):: from .testing import FUNCTIONAL_LAYER - import gocept.pytestlayer.fixture + import zope.pytestlayer.fixture - globals().update(gocept.pytestlayer.fixture.create( + globals().update(zope.pytestlayer.fixture.create( FUNCTIONAL_LAYER, session_fixture_name='functional_session', class_fixture_name='functional_class', function_fixture_name='functional')) -This creates three fixtures with the given names and the scopes in the argument name. The session and class fixtures run `setUp()` and `tearDown()` of the layer if it has not been run before while the function fixture runs `testSetUp()` and `testTearDown()` of the layer. The function fixture depends on the session one. The fixtures return the instance of the layer. So you can use the `functional` fixture like this:: +This creates three fixtures with the given names and the scopes in the argument +name. The session and class fixtures run `setUp()` and `tearDown()` of the +layer if it has not been run before while the function fixture runs +`testSetUp()` and `testTearDown()` of the layer. The function fixture depends +on the session one. The fixtures return the instance of the layer. So you can +use the `functional` fixture like this:: def test_mymodule__my_function__1(functional): assert functional['app'] is not None @@ -72,12 +81,17 @@ This creates three fixtures with the given names and the scopes in the argument Not supported use cases ======================= -* Inheriting from a base class while changing the layer. See commit `f879f9e `_. +* Inheriting from a base class while changing the layer. See commit `f879f9e + `_. -* Mixing classes inheriting ``unittest.TestCase`` and a ``test_suite()`` function (e. g. to create a ``DocTestSuite`` or a ``DocFileSuite``) in a single module (aka file). +* Mixing classes inheriting ``unittest.TestCase`` and a ``test_suite()`` + function (e. g. to create a ``DocTestSuite`` or a ``DocFileSuite``) in a + single module (aka file). - * This is a limitation of the `pytest` test discovery which ignores the doctests in this case. + * This is a limitation of the `pytest` test discovery which ignores the + doctests in this case. * Solution: Put the classes and ``test_suite()`` into different modules. -* A ``doctest.DocFileSuite`` which does not have a ``layer`` is silently skipped. Use the built-in doctest abilities of pytest to run those tests. +* A ``doctest.DocFileSuite`` which does not have a ``layer`` is silently + skipped. Use the built-in doctest abilities of pytest to run those tests. diff --git a/buildout.cfg b/buildout.cfg index 91d5d11..af95317 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -8,7 +8,7 @@ show-picked-versions = true [doc] recipe = zc.recipe.egg eggs = gocept.package [doc] - gocept.pytestlayer + zope.pytestlayer scripts = doc [versions] diff --git a/doc/about.rst b/docs/about.rst similarity index 100% rename from doc/about.rst rename to docs/about.rst diff --git a/doc/api.rst b/docs/api.rst similarity index 75% rename from doc/api.rst rename to docs/api.rst index 9dada78..a1001a2 100644 --- a/doc/api.rst +++ b/docs/api.rst @@ -5,4 +5,4 @@ API Reference .. autosummary:: :toctree: ./_api/ -.. gocept.pytestlayer.foo +.. zope.pytestlayer.foo diff --git a/doc/changes.rst b/docs/changes.rst similarity index 100% rename from doc/changes.rst rename to docs/changes.rst diff --git a/doc/conf.py b/docs/conf.py similarity index 100% rename from doc/conf.py rename to docs/conf.py diff --git a/doc/index.rst b/docs/index.rst similarity index 100% rename from doc/index.rst rename to docs/index.rst diff --git a/setup.cfg b/setup.cfg index 61144b8..8dcc195 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,10 +1,25 @@ -[bdist_wheel] -universal = 0 +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/pure-python + +[flake8] +doctests = 1 +# E501 line too long +per-file-ignores = + src/zope/pytestlayer/tests/test_integration.py: E501 + +[check-manifest] +ignore = + .editorconfig + .meta.toml + docs/_build/html/_sources/* [isort] -lines_between_sections = 0 -lines_after_imports = 2 -no_sections = True -from_first = True -lines_between_types = 0 force_single_line = True +combine_as_imports = True +sections = FUTURE,STDLIB,THIRDPARTY,ZOPE,FIRSTPARTY,LOCALFOLDER +known_third_party = docutils, pkg_resources, pytz +known_zope = +known_first_party = +default_section = ZOPE +line_length = 79 +lines_after_imports = 2 diff --git a/setup.py b/setup.py index 6aa90a7..52d0315 100644 --- a/setup.py +++ b/setup.py @@ -5,14 +5,12 @@ setup( - name='gocept.pytestlayer', + name='zope.pytestlayer', version='8.2.dev0', - python_requires=', '.join([ - '>=3.7', - ]), + python_requires='>=3.7', install_requires=[ - 'pytest >= 6.0', + 'pytest >= 6, < 8', 'setuptools', 'zope.dottedname', ], @@ -21,57 +19,57 @@ 'test': [ 'plone.testing', ], + 'docs': [ + 'Sphinx', + 'gocept.package', + ] }, entry_points={ - 'console_scripts': [ - # 'binary-name = gocept.pytestlayer.module:function' - ], 'pytest11': [ - 'zopelayer = gocept.pytestlayer.plugin', + 'zopelayer = zope.pytestlayer.plugin', ], }, - author='gocept ', - author_email='mail@gocept.com', + author='gocept', + author_email='zope-dev@zope.dev', license='ZPL 2.1', - url='https://github.com/gocept/gocept.pytestlayer/', + url='https://github.com/zope/zope.pytestlayer/', keywords='pytest zope.testrunner layer fixture', - classifiers="""\ -Development Status :: 4 - Beta -Environment :: Console -Framework :: Pytest -Framework :: Plone -Framework :: Zope2 -Framework :: Zope3 -Intended Audience :: Developers -License :: OSI Approved -License :: OSI Approved :: Zope Public License -Natural Language :: English -Operating System :: OS Independent -Programming Language :: Python -Programming Language :: Python :: 3 -Programming Language :: Python :: 3.7 -Programming Language :: Python :: 3.8 -Programming Language :: Python :: 3.9 -Programming Language :: Python :: 3.10 -Programming Language :: Python :: 3.11 -Programming Language :: Python :: Implementation -Programming Language :: Python :: Implementation :: CPython -Programming Language :: Python :: Implementation :: PyPy -Topic :: Software Development -Topic :: Software Development :: Libraries -Topic :: Software Development :: Libraries :: Python Modules -Topic :: Software Development :: Testing -"""[:-1].split('\n'), + classifiers=[ + "Development Status :: 4 - Beta", + "Environment :: Console", + "Framework :: Pytest", + "Framework :: Plone", + "Framework :: Zope :: 3", + "Framework :: Zope :: 5", + "Intended Audience :: Developers", + "License :: OSI Approved :: Zope Public License", + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: Implementation", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Topic :: Software Development", + "Topic :: Software Development :: Libraries", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Software Development :: Testing", + ], description=__doc__.strip(), long_description='\n\n'.join(open(name).read() for name in ( 'README.rst', 'HACKING.rst', 'CHANGES.rst', )), - namespace_packages=['gocept'], + namespace_packages=['zope'], packages=find_packages('src'), package_dir={'': 'src'}, include_package_data=True, diff --git a/src/gocept/pytestlayer/tests/test_doctest.py b/src/gocept/pytestlayer/tests/test_doctest.py deleted file mode 100644 index ef6896a..0000000 --- a/src/gocept/pytestlayer/tests/test_doctest.py +++ /dev/null @@ -1,16 +0,0 @@ -from gocept.pytestlayer.doctest import DocTestSuite - - -class Dummy: - """This class has a doctest. - - It tests the workaround for - https://github.com/gocept/gocept.pytestlayer/issues/4 - - >>> print('foobar.') - foobar. - """ - - -def test_suite(): - return DocTestSuite('gocept.pytestlayer.tests.test_doctest') diff --git a/src/gocept/__init__.py b/src/zope/__init__.py similarity index 100% rename from src/gocept/__init__.py rename to src/zope/__init__.py diff --git a/src/gocept/pytestlayer/__init__.py b/src/zope/pytestlayer/__init__.py similarity index 100% rename from src/gocept/pytestlayer/__init__.py rename to src/zope/pytestlayer/__init__.py diff --git a/src/gocept/pytestlayer/_compat.py b/src/zope/pytestlayer/_compat.py similarity index 100% rename from src/gocept/pytestlayer/_compat.py rename to src/zope/pytestlayer/_compat.py diff --git a/src/gocept/pytestlayer/doctest.py b/src/zope/pytestlayer/doctest.py similarity index 57% rename from src/gocept/pytestlayer/doctest.py rename to src/zope/pytestlayer/doctest.py index c75d6a9..b28d0f4 100644 --- a/src/gocept/pytestlayer/doctest.py +++ b/src/zope/pytestlayer/doctest.py @@ -2,9 +2,9 @@ class NoOpLayer: - """Layer needed for gocept.pytestlayer to find and run doctests. + """Layer needed for zope.pytestlayer to find and run doctests. - See https://github.com/gocept/gocept.pytestlayer/issues/4 + See https://github.com/zope/zope.pytestlayer/issues/4 """ __name__ = 'NoOpLayer' @@ -21,9 +21,9 @@ def tearDown(self): def DocTestSuite(*args, **kw): - """A DocTestSuite whose tests are detectable by gocept.pytestlayer. + """A DocTestSuite whose tests are detectable by zope.pytestlayer. - See https://github.com/gocept/gocept.pytestlayer/issues/4 + See https://github.com/zope/zope.pytestlayer/issues/4 """ layer = kw.pop('layer', NOOP_LAYER) suite = doctest.DocTestSuite(*args, **kw) diff --git a/src/gocept/pytestlayer/fixture.py b/src/zope/pytestlayer/fixture.py similarity index 99% rename from src/gocept/pytestlayer/fixture.py rename to src/zope/pytestlayer/fixture.py index fe1e847..6462a80 100644 --- a/src/gocept/pytestlayer/fixture.py +++ b/src/zope/pytestlayer/fixture.py @@ -1,8 +1,9 @@ import contextlib -import imp -import pytest import re import time +import types + +import pytest import zope.dottedname.resolve @@ -204,7 +205,7 @@ def parsefactories(collector, layer): ns = create(layer) if ns: name = get_fixture_name(layer, scope='function') - module = imp.new_module(name) + module = types.ModuleType(name) module.__dict__.update(ns) collector.session._fixturemanager.parsefactories(module, '') diff --git a/src/gocept/pytestlayer/layered.py b/src/zope/pytestlayer/layered.py similarity index 98% rename from src/gocept/pytestlayer/layered.py rename to src/zope/pytestlayer/layered.py index d028186..75ec3fa 100644 --- a/src/gocept/pytestlayer/layered.py +++ b/src/zope/pytestlayer/layered.py @@ -1,7 +1,9 @@ -from gocept.pytestlayer import fixture +import unittest + import _pytest.unittest import pytest -import unittest + +from zope.pytestlayer import fixture class LayeredTestSuite(pytest.Class): diff --git a/src/gocept/pytestlayer/plugin.py b/src/zope/pytestlayer/plugin.py similarity index 97% rename from src/gocept/pytestlayer/plugin.py rename to src/zope/pytestlayer/plugin.py index a679cc9..ae6dcab 100644 --- a/src/gocept/pytestlayer/plugin.py +++ b/src/zope/pytestlayer/plugin.py @@ -1,10 +1,13 @@ -from ._compat import getmro -from gocept.pytestlayer import fixture -from gocept.pytestlayer import layered -import pytest import types import unittest +import pytest + +from zope.pytestlayer import fixture +from zope.pytestlayer import layered + +from ._compat import getmro + @pytest.mark.tryfirst def pytest_pycollect_makeitem(collector, name, obj): diff --git a/src/gocept/pytestlayer/testing.py b/src/zope/pytestlayer/testing.py similarity index 100% rename from src/gocept/pytestlayer/testing.py rename to src/zope/pytestlayer/testing.py diff --git a/src/gocept/pytestlayer/tests/__init__.py b/src/zope/pytestlayer/tests/__init__.py similarity index 100% rename from src/gocept/pytestlayer/tests/__init__.py rename to src/zope/pytestlayer/tests/__init__.py diff --git a/src/gocept/pytestlayer/tests/conftest.py b/src/zope/pytestlayer/tests/conftest.py similarity index 100% rename from src/gocept/pytestlayer/tests/conftest.py rename to src/zope/pytestlayer/tests/conftest.py diff --git a/src/gocept/pytestlayer/tests/fixture/bad_layer/__init__.py b/src/zope/pytestlayer/tests/fixture/bad_layer/__init__.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/bad_layer/__init__.py rename to src/zope/pytestlayer/tests/fixture/bad_layer/__init__.py diff --git a/src/gocept/pytestlayer/tests/fixture/bad_layer/conftest.py b/src/zope/pytestlayer/tests/fixture/bad_layer/conftest.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/bad_layer/conftest.py rename to src/zope/pytestlayer/tests/fixture/bad_layer/conftest.py diff --git a/src/gocept/pytestlayer/tests/fixture/bad_layer/test_core.py b/src/zope/pytestlayer/tests/fixture/bad_layer/test_core.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/bad_layer/test_core.py rename to src/zope/pytestlayer/tests/fixture/bad_layer/test_core.py diff --git a/src/gocept/pytestlayer/tests/fixture/custom_fixture_name/__init__.py b/src/zope/pytestlayer/tests/fixture/custom_fixture_name/__init__.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/custom_fixture_name/__init__.py rename to src/zope/pytestlayer/tests/fixture/custom_fixture_name/__init__.py diff --git a/src/gocept/pytestlayer/tests/fixture/custom_fixture_name/conftest.py b/src/zope/pytestlayer/tests/fixture/custom_fixture_name/conftest.py similarity index 68% rename from src/gocept/pytestlayer/tests/fixture/custom_fixture_name/conftest.py rename to src/zope/pytestlayer/tests/fixture/custom_fixture_name/conftest.py index c90dcbc..a2e6f44 100644 --- a/src/gocept/pytestlayer/tests/fixture/custom_fixture_name/conftest.py +++ b/src/zope/pytestlayer/tests/fixture/custom_fixture_name/conftest.py @@ -1,11 +1,12 @@ from custom_fixture_name.test_core import FooLayer -import gocept.pytestlayer.fixture + +import zope.pytestlayer.fixture pytest_plugins = ('zopelayer', ) -globals().update(gocept.pytestlayer.fixture.create( +globals().update(zope.pytestlayer.fixture.create( FooLayer, class_fixture_name='foo_layer_class', function_fixture_name='foo_layer')) diff --git a/src/gocept/pytestlayer/tests/fixture/custom_fixture_name/test_core.py b/src/zope/pytestlayer/tests/fixture/custom_fixture_name/test_core.py similarity index 93% rename from src/gocept/pytestlayer/tests/fixture/custom_fixture_name/test_core.py rename to src/zope/pytestlayer/tests/fixture/custom_fixture_name/test_core.py index 0747a07..7987fc1 100644 --- a/src/gocept/pytestlayer/tests/fixture/custom_fixture_name/test_core.py +++ b/src/zope/pytestlayer/tests/fixture/custom_fixture_name/test_core.py @@ -1,6 +1,7 @@ -from gocept.pytestlayer.testing import log_to_terminal import unittest +from zope.pytestlayer.testing import log_to_terminal + class FooLayer(object): diff --git a/src/gocept/pytestlayer/tests/fixture/keep_layer_across_test_classes/__init__.py b/src/zope/pytestlayer/tests/fixture/keep_layer_across_test_classes/__init__.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/keep_layer_across_test_classes/__init__.py rename to src/zope/pytestlayer/tests/fixture/keep_layer_across_test_classes/__init__.py diff --git a/src/gocept/pytestlayer/tests/fixture/keep_layer_across_test_classes/conftest.py b/src/zope/pytestlayer/tests/fixture/keep_layer_across_test_classes/conftest.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/keep_layer_across_test_classes/conftest.py rename to src/zope/pytestlayer/tests/fixture/keep_layer_across_test_classes/conftest.py diff --git a/src/gocept/pytestlayer/tests/fixture/keep_layer_across_test_classes/test_core.py b/src/zope/pytestlayer/tests/fixture/keep_layer_across_test_classes/test_core.py similarity index 97% rename from src/gocept/pytestlayer/tests/fixture/keep_layer_across_test_classes/test_core.py rename to src/zope/pytestlayer/tests/fixture/keep_layer_across_test_classes/test_core.py index fd66c26..9e0ca85 100644 --- a/src/gocept/pytestlayer/tests/fixture/keep_layer_across_test_classes/test_core.py +++ b/src/zope/pytestlayer/tests/fixture/keep_layer_across_test_classes/test_core.py @@ -1,6 +1,7 @@ -from gocept.pytestlayer.testing import log_to_terminal import unittest +from zope.pytestlayer.testing import log_to_terminal + class FooLayer(object): diff --git a/src/gocept/pytestlayer/tests/fixture/layers_with_same_name/__init__.py b/src/zope/pytestlayer/tests/fixture/layers_with_same_name/__init__.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/layers_with_same_name/__init__.py rename to src/zope/pytestlayer/tests/fixture/layers_with_same_name/__init__.py diff --git a/src/gocept/pytestlayer/tests/fixture/layers_with_same_name/conftest.py b/src/zope/pytestlayer/tests/fixture/layers_with_same_name/conftest.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/layers_with_same_name/conftest.py rename to src/zope/pytestlayer/tests/fixture/layers_with_same_name/conftest.py diff --git a/src/gocept/pytestlayer/tests/fixture/layers_with_same_name/test_core.py b/src/zope/pytestlayer/tests/fixture/layers_with_same_name/test_core.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/layers_with_same_name/test_core.py rename to src/zope/pytestlayer/tests/fixture/layers_with_same_name/test_core.py diff --git a/src/gocept/pytestlayer/tests/fixture/no_setup_or_teardown/__init__.py b/src/zope/pytestlayer/tests/fixture/no_setup_or_teardown/__init__.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/no_setup_or_teardown/__init__.py rename to src/zope/pytestlayer/tests/fixture/no_setup_or_teardown/__init__.py diff --git a/src/gocept/pytestlayer/tests/fixture/no_setup_or_teardown/conftest.py b/src/zope/pytestlayer/tests/fixture/no_setup_or_teardown/conftest.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/no_setup_or_teardown/conftest.py rename to src/zope/pytestlayer/tests/fixture/no_setup_or_teardown/conftest.py diff --git a/src/gocept/pytestlayer/tests/fixture/no_setup_or_teardown/test_core.py b/src/zope/pytestlayer/tests/fixture/no_setup_or_teardown/test_core.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/no_setup_or_teardown/test_core.py rename to src/zope/pytestlayer/tests/fixture/no_setup_or_teardown/test_core.py diff --git a/src/gocept/pytestlayer/tests/fixture/order_by_layer/__init__.py b/src/zope/pytestlayer/tests/fixture/order_by_layer/__init__.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/order_by_layer/__init__.py rename to src/zope/pytestlayer/tests/fixture/order_by_layer/__init__.py diff --git a/src/gocept/pytestlayer/tests/fixture/order_by_layer/conftest.py b/src/zope/pytestlayer/tests/fixture/order_by_layer/conftest.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/order_by_layer/conftest.py rename to src/zope/pytestlayer/tests/fixture/order_by_layer/conftest.py diff --git a/src/gocept/pytestlayer/tests/fixture/order_by_layer/test_core.py b/src/zope/pytestlayer/tests/fixture/order_by_layer/test_core.py similarity index 98% rename from src/gocept/pytestlayer/tests/fixture/order_by_layer/test_core.py rename to src/zope/pytestlayer/tests/fixture/order_by_layer/test_core.py index 800749a..079e75f 100644 --- a/src/gocept/pytestlayer/tests/fixture/order_by_layer/test_core.py +++ b/src/zope/pytestlayer/tests/fixture/order_by_layer/test_core.py @@ -1,6 +1,7 @@ -from gocept.pytestlayer.testing import log_to_terminal import unittest +from zope.pytestlayer.testing import log_to_terminal + class FooLayer(object): diff --git a/src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/__init__.py b/src/zope/pytestlayer/tests/fixture/order_with_layered_suite/__init__.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/__init__.py rename to src/zope/pytestlayer/tests/fixture/order_with_layered_suite/__init__.py diff --git a/src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/conftest.py b/src/zope/pytestlayer/tests/fixture/order_with_layered_suite/conftest.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/conftest.py rename to src/zope/pytestlayer/tests/fixture/order_with_layered_suite/conftest.py diff --git a/src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/foo.txt b/src/zope/pytestlayer/tests/fixture/order_with_layered_suite/foo.txt similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/foo.txt rename to src/zope/pytestlayer/tests/fixture/order_with_layered_suite/foo.txt diff --git a/src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/foobar.txt b/src/zope/pytestlayer/tests/fixture/order_with_layered_suite/foobar.txt similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/foobar.txt rename to src/zope/pytestlayer/tests/fixture/order_with_layered_suite/foobar.txt diff --git a/src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py b/src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py similarity index 98% rename from src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py rename to src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py index 134f8d8..4303441 100644 --- a/src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py +++ b/src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py @@ -1,8 +1,10 @@ -from gocept.pytestlayer.testing import log_to_terminal -from plone.testing import layered import doctest import unittest +from plone.testing import layered + +from zope.pytestlayer.testing import log_to_terminal + class FooLayer(object): diff --git a/src/gocept/pytestlayer/tests/fixture/session_fixture/__init__.py b/src/zope/pytestlayer/tests/fixture/session_fixture/__init__.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/session_fixture/__init__.py rename to src/zope/pytestlayer/tests/fixture/session_fixture/__init__.py diff --git a/src/gocept/pytestlayer/tests/fixture/session_fixture/conftest.py b/src/zope/pytestlayer/tests/fixture/session_fixture/conftest.py similarity index 72% rename from src/gocept/pytestlayer/tests/fixture/session_fixture/conftest.py rename to src/zope/pytestlayer/tests/fixture/session_fixture/conftest.py index 8ab0b10..acb5282 100644 --- a/src/gocept/pytestlayer/tests/fixture/session_fixture/conftest.py +++ b/src/zope/pytestlayer/tests/fixture/session_fixture/conftest.py @@ -1,11 +1,12 @@ from session_fixture.test_core import FooLayer -import gocept.pytestlayer.fixture + +import zope.pytestlayer.fixture pytest_plugins = ('zopelayer', ) -globals().update(gocept.pytestlayer.fixture.create( +globals().update(zope.pytestlayer.fixture.create( FooLayer, session_fixture_name='foo_layer_session', class_fixture_name='foo_layer_class', diff --git a/src/gocept/pytestlayer/tests/fixture/session_fixture/test_core.py b/src/zope/pytestlayer/tests/fixture/session_fixture/test_core.py similarity index 93% rename from src/gocept/pytestlayer/tests/fixture/session_fixture/test_core.py rename to src/zope/pytestlayer/tests/fixture/session_fixture/test_core.py index 85cbd19..f690af7 100644 --- a/src/gocept/pytestlayer/tests/fixture/session_fixture/test_core.py +++ b/src/zope/pytestlayer/tests/fixture/session_fixture/test_core.py @@ -1,6 +1,7 @@ -from gocept.pytestlayer.testing import log_to_terminal import unittest +from zope.pytestlayer.testing import log_to_terminal + class FooLayer(object): diff --git a/src/gocept/pytestlayer/tests/fixture/shared_with_layered_suite/__init__.py b/src/zope/pytestlayer/tests/fixture/shared_with_layered_suite/__init__.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/shared_with_layered_suite/__init__.py rename to src/zope/pytestlayer/tests/fixture/shared_with_layered_suite/__init__.py diff --git a/src/gocept/pytestlayer/tests/fixture/shared_with_layered_suite/conftest.py b/src/zope/pytestlayer/tests/fixture/shared_with_layered_suite/conftest.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/shared_with_layered_suite/conftest.py rename to src/zope/pytestlayer/tests/fixture/shared_with_layered_suite/conftest.py diff --git a/src/gocept/pytestlayer/tests/fixture/shared_with_layered_suite/mydoctest.txt b/src/zope/pytestlayer/tests/fixture/shared_with_layered_suite/mydoctest.txt similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/shared_with_layered_suite/mydoctest.txt rename to src/zope/pytestlayer/tests/fixture/shared_with_layered_suite/mydoctest.txt diff --git a/src/gocept/pytestlayer/tests/fixture/shared_with_layered_suite/test_core.py b/src/zope/pytestlayer/tests/fixture/shared_with_layered_suite/test_core.py similarity index 95% rename from src/gocept/pytestlayer/tests/fixture/shared_with_layered_suite/test_core.py rename to src/zope/pytestlayer/tests/fixture/shared_with_layered_suite/test_core.py index 688ce34..6380f89 100644 --- a/src/gocept/pytestlayer/tests/fixture/shared_with_layered_suite/test_core.py +++ b/src/zope/pytestlayer/tests/fixture/shared_with_layered_suite/test_core.py @@ -1,8 +1,10 @@ -from gocept.pytestlayer.testing import log_to_terminal -from plone.testing import layered import doctest import unittest +from plone.testing import layered + +from zope.pytestlayer.testing import log_to_terminal + class FooLayer(object): diff --git a/src/gocept/pytestlayer/tests/fixture/single_layer/__init__.py b/src/zope/pytestlayer/tests/fixture/single_layer/__init__.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/single_layer/__init__.py rename to src/zope/pytestlayer/tests/fixture/single_layer/__init__.py diff --git a/src/gocept/pytestlayer/tests/fixture/single_layer/conftest.py b/src/zope/pytestlayer/tests/fixture/single_layer/conftest.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/single_layer/conftest.py rename to src/zope/pytestlayer/tests/fixture/single_layer/conftest.py diff --git a/src/gocept/pytestlayer/tests/fixture/single_layer/test_core.py b/src/zope/pytestlayer/tests/fixture/single_layer/test_core.py similarity index 92% rename from src/gocept/pytestlayer/tests/fixture/single_layer/test_core.py rename to src/zope/pytestlayer/tests/fixture/single_layer/test_core.py index 174d647..90cdcb0 100644 --- a/src/gocept/pytestlayer/tests/fixture/single_layer/test_core.py +++ b/src/zope/pytestlayer/tests/fixture/single_layer/test_core.py @@ -1,6 +1,7 @@ -from gocept.pytestlayer.testing import log_to_terminal import unittest +from zope.pytestlayer.testing import log_to_terminal + class FooLayer(object): diff --git a/src/gocept/pytestlayer/tests/fixture/single_layer_in_two_modules/__init__.py b/src/zope/pytestlayer/tests/fixture/single_layer_in_two_modules/__init__.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/single_layer_in_two_modules/__init__.py rename to src/zope/pytestlayer/tests/fixture/single_layer_in_two_modules/__init__.py diff --git a/src/gocept/pytestlayer/tests/fixture/single_layer_in_two_modules/conftest.py b/src/zope/pytestlayer/tests/fixture/single_layer_in_two_modules/conftest.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/single_layer_in_two_modules/conftest.py rename to src/zope/pytestlayer/tests/fixture/single_layer_in_two_modules/conftest.py diff --git a/src/gocept/pytestlayer/tests/fixture/single_layer_in_two_modules/test_core.py b/src/zope/pytestlayer/tests/fixture/single_layer_in_two_modules/test_core.py similarity index 92% rename from src/gocept/pytestlayer/tests/fixture/single_layer_in_two_modules/test_core.py rename to src/zope/pytestlayer/tests/fixture/single_layer_in_two_modules/test_core.py index 174d647..90cdcb0 100644 --- a/src/gocept/pytestlayer/tests/fixture/single_layer_in_two_modules/test_core.py +++ b/src/zope/pytestlayer/tests/fixture/single_layer_in_two_modules/test_core.py @@ -1,6 +1,7 @@ -from gocept.pytestlayer.testing import log_to_terminal import unittest +from zope.pytestlayer.testing import log_to_terminal + class FooLayer(object): diff --git a/src/gocept/pytestlayer/tests/fixture/single_layer_in_two_modules/test_second_module.py b/src/zope/pytestlayer/tests/fixture/single_layer_in_two_modules/test_second_module.py similarity index 99% rename from src/gocept/pytestlayer/tests/fixture/single_layer_in_two_modules/test_second_module.py rename to src/zope/pytestlayer/tests/fixture/single_layer_in_two_modules/test_second_module.py index f45cc37..423680d 100644 --- a/src/gocept/pytestlayer/tests/fixture/single_layer_in_two_modules/test_second_module.py +++ b/src/zope/pytestlayer/tests/fixture/single_layer_in_two_modules/test_second_module.py @@ -1,6 +1,7 @@ -from .test_core import FooLayer import unittest +from .test_core import FooLayer + class FooTest(unittest.TestCase): diff --git a/src/gocept/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/__init__.py b/src/zope/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/__init__.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/__init__.py rename to src/zope/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/__init__.py diff --git a/src/gocept/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/conftest.py b/src/zope/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/conftest.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/conftest.py rename to src/zope/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/conftest.py diff --git a/src/gocept/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/test_core.py b/src/zope/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/test_core.py similarity index 95% rename from src/gocept/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/test_core.py rename to src/zope/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/test_core.py index 959b472..7c6a495 100644 --- a/src/gocept/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/test_core.py +++ b/src/zope/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/test_core.py @@ -1,6 +1,7 @@ -from gocept.pytestlayer.testing import log_to_terminal import unittest +from zope.pytestlayer.testing import log_to_terminal + class BarLayer(object): diff --git a/src/gocept/pytestlayer/tests/fixture/single_layered_suite/__init__.py b/src/zope/pytestlayer/tests/fixture/single_layered_suite/__init__.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/single_layered_suite/__init__.py rename to src/zope/pytestlayer/tests/fixture/single_layered_suite/__init__.py diff --git a/src/gocept/pytestlayer/tests/fixture/single_layered_suite/conftest.py b/src/zope/pytestlayer/tests/fixture/single_layered_suite/conftest.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/single_layered_suite/conftest.py rename to src/zope/pytestlayer/tests/fixture/single_layered_suite/conftest.py diff --git a/src/gocept/pytestlayer/tests/fixture/single_layered_suite/doctest.txt b/src/zope/pytestlayer/tests/fixture/single_layered_suite/doctest.txt similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/single_layered_suite/doctest.txt rename to src/zope/pytestlayer/tests/fixture/single_layered_suite/doctest.txt diff --git a/src/gocept/pytestlayer/tests/fixture/single_layered_suite/test_core.py b/src/zope/pytestlayer/tests/fixture/single_layered_suite/test_core.py similarity index 93% rename from src/gocept/pytestlayer/tests/fixture/single_layered_suite/test_core.py rename to src/zope/pytestlayer/tests/fixture/single_layered_suite/test_core.py index 880e58b..ab16ed2 100644 --- a/src/gocept/pytestlayer/tests/fixture/single_layered_suite/test_core.py +++ b/src/zope/pytestlayer/tests/fixture/single_layered_suite/test_core.py @@ -1,8 +1,10 @@ -from gocept.pytestlayer.testing import log_to_terminal -from plone.testing import layered import doctest import unittest +from plone.testing import layered + +from zope.pytestlayer.testing import log_to_terminal + class FooLayer(object): diff --git a/src/gocept/pytestlayer/tests/fixture/two_dependent_layered_suites/__init__.py b/src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/__init__.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/two_dependent_layered_suites/__init__.py rename to src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/__init__.py diff --git a/src/gocept/pytestlayer/tests/fixture/two_dependent_layered_suites/bar.txt b/src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/bar.txt similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/two_dependent_layered_suites/bar.txt rename to src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/bar.txt diff --git a/src/gocept/pytestlayer/tests/fixture/two_dependent_layered_suites/conftest.py b/src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/conftest.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/two_dependent_layered_suites/conftest.py rename to src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/conftest.py diff --git a/src/gocept/pytestlayer/tests/fixture/two_dependent_layered_suites/foo.txt b/src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/foo.txt similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/two_dependent_layered_suites/foo.txt rename to src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/foo.txt diff --git a/src/gocept/pytestlayer/tests/fixture/two_dependent_layered_suites/test_core.py b/src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/test_core.py similarity index 96% rename from src/gocept/pytestlayer/tests/fixture/two_dependent_layered_suites/test_core.py rename to src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/test_core.py index 8190008..76e26fc 100644 --- a/src/gocept/pytestlayer/tests/fixture/two_dependent_layered_suites/test_core.py +++ b/src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/test_core.py @@ -1,8 +1,10 @@ -from gocept.pytestlayer.testing import log_to_terminal -from plone.testing import layered import doctest import unittest +from plone.testing import layered + +from zope.pytestlayer.testing import log_to_terminal + class FooLayer(object): diff --git a/src/gocept/pytestlayer/tests/fixture/two_dependent_layers/__init__.py b/src/zope/pytestlayer/tests/fixture/two_dependent_layers/__init__.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/two_dependent_layers/__init__.py rename to src/zope/pytestlayer/tests/fixture/two_dependent_layers/__init__.py diff --git a/src/gocept/pytestlayer/tests/fixture/two_dependent_layers/conftest.py b/src/zope/pytestlayer/tests/fixture/two_dependent_layers/conftest.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/two_dependent_layers/conftest.py rename to src/zope/pytestlayer/tests/fixture/two_dependent_layers/conftest.py diff --git a/src/gocept/pytestlayer/tests/fixture/two_dependent_layers/test_core.py b/src/zope/pytestlayer/tests/fixture/two_dependent_layers/test_core.py similarity index 96% rename from src/gocept/pytestlayer/tests/fixture/two_dependent_layers/test_core.py rename to src/zope/pytestlayer/tests/fixture/two_dependent_layers/test_core.py index 5327b3b..4e0b0cf 100644 --- a/src/gocept/pytestlayer/tests/fixture/two_dependent_layers/test_core.py +++ b/src/zope/pytestlayer/tests/fixture/two_dependent_layers/test_core.py @@ -1,6 +1,7 @@ -from gocept.pytestlayer.testing import log_to_terminal import unittest +from zope.pytestlayer.testing import log_to_terminal + class FooLayer(object): diff --git a/src/gocept/pytestlayer/tests/fixture/two_independent_layers/__init__.py b/src/zope/pytestlayer/tests/fixture/two_independent_layers/__init__.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/two_independent_layers/__init__.py rename to src/zope/pytestlayer/tests/fixture/two_independent_layers/__init__.py diff --git a/src/gocept/pytestlayer/tests/fixture/two_independent_layers/conftest.py b/src/zope/pytestlayer/tests/fixture/two_independent_layers/conftest.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/two_independent_layers/conftest.py rename to src/zope/pytestlayer/tests/fixture/two_independent_layers/conftest.py diff --git a/src/gocept/pytestlayer/tests/fixture/two_independent_layers/test_core.py b/src/zope/pytestlayer/tests/fixture/two_independent_layers/test_core.py similarity index 96% rename from src/gocept/pytestlayer/tests/fixture/two_independent_layers/test_core.py rename to src/zope/pytestlayer/tests/fixture/two_independent_layers/test_core.py index 147ebb0..785cad4 100644 --- a/src/gocept/pytestlayer/tests/fixture/two_independent_layers/test_core.py +++ b/src/zope/pytestlayer/tests/fixture/two_independent_layers/test_core.py @@ -1,6 +1,7 @@ -from gocept.pytestlayer.testing import log_to_terminal import unittest +from zope.pytestlayer.testing import log_to_terminal + class FooLayer(object): diff --git a/src/gocept/pytestlayer/tests/fixture/with_and_without_layer/__init__.py b/src/zope/pytestlayer/tests/fixture/with_and_without_layer/__init__.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/with_and_without_layer/__init__.py rename to src/zope/pytestlayer/tests/fixture/with_and_without_layer/__init__.py diff --git a/src/gocept/pytestlayer/tests/fixture/with_and_without_layer/conftest.py b/src/zope/pytestlayer/tests/fixture/with_and_without_layer/conftest.py similarity index 100% rename from src/gocept/pytestlayer/tests/fixture/with_and_without_layer/conftest.py rename to src/zope/pytestlayer/tests/fixture/with_and_without_layer/conftest.py diff --git a/src/gocept/pytestlayer/tests/fixture/with_and_without_layer/test_core.py b/src/zope/pytestlayer/tests/fixture/with_and_without_layer/test_core.py similarity index 93% rename from src/gocept/pytestlayer/tests/fixture/with_and_without_layer/test_core.py rename to src/zope/pytestlayer/tests/fixture/with_and_without_layer/test_core.py index 8676e55..18ecd7f 100644 --- a/src/gocept/pytestlayer/tests/fixture/with_and_without_layer/test_core.py +++ b/src/zope/pytestlayer/tests/fixture/with_and_without_layer/test_core.py @@ -1,6 +1,7 @@ -from gocept.pytestlayer.testing import log_to_terminal import unittest +from zope.pytestlayer.testing import log_to_terminal + class FooLayer(object): diff --git a/src/zope/pytestlayer/tests/test_doctest.py b/src/zope/pytestlayer/tests/test_doctest.py new file mode 100644 index 0000000..1c48d22 --- /dev/null +++ b/src/zope/pytestlayer/tests/test_doctest.py @@ -0,0 +1,16 @@ +from zope.pytestlayer.doctest import DocTestSuite + + +class Dummy: + """This class has a doctest. + + It tests the workaround for + https://github.com/zope/zope.pytestlayer/issues/4 + + >>> print('foobar.') + foobar. + """ + + +def test_suite(): + return DocTestSuite('zope.pytestlayer.tests.test_doctest') diff --git a/src/gocept/pytestlayer/tests/test_fixture.py b/src/zope/pytestlayer/tests/test_fixture.py similarity index 50% rename from src/gocept/pytestlayer/tests/test_fixture.py rename to src/zope/pytestlayer/tests/test_fixture.py index ca99224..6c5c121 100644 --- a/src/gocept/pytestlayer/tests/test_fixture.py +++ b/src/zope/pytestlayer/tests/test_fixture.py @@ -7,11 +7,11 @@ class Layer(object): def test_create_accepts_dotted_names_of_layers(): fixtures = sorted(fixture.create( - 'gocept.pytestlayer.tests.test_fixture.Layer').keys()) + 'zope.pytestlayer.tests.test_fixture.Layer').keys()) assert 3 == len(fixtures) assert fixtures[0].startswith( - 'zope_layer_class_gocept_pytestlayer_tests_test_fixture_Layer_') + 'zope_layer_class_zope_pytestlayer_tests_test_fixture_Layer_') assert fixtures[1].startswith( - 'zope_layer_function_gocept_pytestlayer_tests_test_fixture_Layer_') + 'zope_layer_function_zope_pytestlayer_tests_test_fixture_Layer_') assert fixtures[2].startswith( - 'zope_layer_session_gocept_pytestlayer_tests_test_fixture_Layer_') + 'zope_layer_session_zope_pytestlayer_tests_test_fixture_Layer_') diff --git a/src/gocept/pytestlayer/tests/test_integration.py b/src/zope/pytestlayer/tests/test_integration.py similarity index 56% rename from src/gocept/pytestlayer/tests/test_integration.py rename to src/zope/pytestlayer/tests/test_integration.py index 6de7d32..fa6675a 100644 --- a/src/gocept/pytestlayer/tests/test_integration.py +++ b/src/zope/pytestlayer/tests/test_integration.py @@ -1,9 +1,10 @@ import os.path -import pytest import re import subprocess import sys +import pytest + normalizers = [ (r'\d+\.\d+ seconds', 'N.NNN seconds'), @@ -19,7 +20,7 @@ # matches [NNN%], [ NN%] and [ N%] (r'PASSED \[\s*\d{1,3}%\]', 'PASSED'), # needed to omit all other loaded plugins. - (r'plugins:.*(gocept.pytestlayer).*\n', 'plugins: gocept.pytestlayer\n'), + (r'plugins:.*(zope.pytestlayer).*\n', 'plugins: zope.pytestlayer\n'), ] @@ -31,7 +32,7 @@ def where(request): ''' relative = request.fspath.relto(request.session.fspath) from_src = os.path.join( - 'src', 'gocept', 'pytestlayer', 'tests', 'test_integration.py' + 'src', 'zope', 'pytestlayer', 'tests', 'test_integration.py' ) root = re.escape(relative.replace(from_src, '')) root_2 = str(request.session.fspath) @@ -71,12 +72,12 @@ def join(lines, start=4, end=1): def test_single_layer(where): lines = run_pytest('single_layer') assert """\ -plugins: gocept.pytestlayer +plugins: zope.pytestlayer collecting ... collected 1 item -src/gocept/pytestlayer/tests/fixture/single_layer/test_core.py:NN: FooTest.test_dummy single_layer.test_core.FooLayer +src/zope/pytestlayer/tests/fixture/single_layer/test_core.py:NN: FooTest.test_dummy single_layer.test_core.FooLayer Set up single_layer.test_core.FooLayer in N.NNN seconds. testSetUp foo -src/gocept/pytestlayer/tests/fixture/single_layer/test_core.py:NN: FooTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/single_layer/test_core.py:NN: FooTest.test_dummy PASSED testTearDown foo Tear down single_layer.test_core.FooLayer in N.NNN seconds. """ == join(lines) @@ -86,15 +87,15 @@ def test_single_layer(where): def test_single_layer_with_unattached_base_layer(where): lines = run_pytest('single_layer_with_unattached_base_layer') assert """\ -plugins: gocept.pytestlayer +plugins: zope.pytestlayer collecting ... collected 1 item -src/gocept/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/test_core.py:NN: FooTest.test_dummy single_layer_with_unattached_base_layer.test_core.BarLayer +src/zope/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/test_core.py:NN: FooTest.test_dummy single_layer_with_unattached_base_layer.test_core.BarLayer Set up single_layer_with_unattached_base_layer.test_core.BarLayer in N.NNN seconds. single_layer_with_unattached_base_layer.test_core.FooLayer Set up single_layer_with_unattached_base_layer.test_core.FooLayer in N.NNN seconds. testSetUp bar testSetUp foo -src/gocept/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/test_core.py:NN: FooTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/test_core.py:NN: FooTest.test_dummy PASSED testTearDown foo testTearDown bar Tear down single_layer_with_unattached_base_layer.test_core.FooLayer in N.NNN seconds. @@ -108,15 +109,15 @@ def test_single_layer_with_unattached_base_layer_select_layer(where): 'single_layer_with_unattached_base_layer', '-k', 'BarLayer' ) assert """\ -plugins: gocept.pytestlayer +plugins: zope.pytestlayer collecting ... collected 1 item -src/gocept/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/test_core.py:NN: FooTest.test_dummy single_layer_with_unattached_base_layer.test_core.BarLayer +src/zope/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/test_core.py:NN: FooTest.test_dummy single_layer_with_unattached_base_layer.test_core.BarLayer Set up single_layer_with_unattached_base_layer.test_core.BarLayer in N.NNN seconds. single_layer_with_unattached_base_layer.test_core.FooLayer Set up single_layer_with_unattached_base_layer.test_core.FooLayer in N.NNN seconds. testSetUp bar testSetUp foo -src/gocept/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/test_core.py:NN: FooTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/single_layer_with_unattached_base_layer/test_core.py:NN: FooTest.test_dummy PASSED testTearDown foo testTearDown bar Tear down single_layer_with_unattached_base_layer.test_core.FooLayer in N.NNN seconds. @@ -128,16 +129,16 @@ def test_single_layer_with_unattached_base_layer_select_layer(where): def test_single_layer_in_two_modules(where): lines = run_pytest('single_layer_in_two_modules') assert """\ -plugins: gocept.pytestlayer +plugins: zope.pytestlayer collecting ... collected 2 items -src/gocept/pytestlayer/tests/fixture/single_layer_in_two_modules/test_core.py:NN: FooTest.test_dummy single_layer_in_two_modules.test_core.FooLayer +src/zope/pytestlayer/tests/fixture/single_layer_in_two_modules/test_core.py:NN: FooTest.test_dummy single_layer_in_two_modules.test_core.FooLayer Set up single_layer_in_two_modules.test_core.FooLayer in N.NNN seconds. testSetUp foo -src/gocept/pytestlayer/tests/fixture/single_layer_in_two_modules/test_core.py:NN: FooTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/single_layer_in_two_modules/test_core.py:NN: FooTest.test_dummy PASSED testTearDown foo -src/gocept/pytestlayer/tests/fixture/single_layer_in_two_modules/test_second_module.py:NN: FooTest.test_dummy +src/zope/pytestlayer/tests/fixture/single_layer_in_two_modules/test_second_module.py:NN: FooTest.test_dummy testSetUp foo -src/gocept/pytestlayer/tests/fixture/single_layer_in_two_modules/test_second_module.py:NN: FooTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/single_layer_in_two_modules/test_second_module.py:NN: FooTest.test_dummy PASSED testTearDown foo Tear down single_layer_in_two_modules.test_core.FooLayer in N.NNN seconds. """ == join(lines) @@ -147,12 +148,12 @@ def test_single_layer_in_two_modules(where): def test_single_layered_suite(where): lines = run_pytest('single_layered_suite') assert """\ -plugins: gocept.pytestlayer +plugins: zope.pytestlayer collecting ... collected 1 item -src/gocept/pytestlayer/tests/fixture/single_layered_suite/test_core.py <- test_suite: /src/gocept/pytestlayer/tests/fixture/single_layered_suite/doctest.txt single_layered_suite.test_core.FooLayer +src/zope/pytestlayer/tests/fixture/single_layered_suite/test_core.py <- test_suite: /src/zope/pytestlayer/tests/fixture/single_layered_suite/doctest.txt single_layered_suite.test_core.FooLayer Set up single_layered_suite.test_core.FooLayer in N.NNN seconds. testSetUp foo -src/gocept/pytestlayer/tests/fixture/single_layered_suite/test_core.py <- test_suite: /src/gocept/pytestlayer/tests/fixture/single_layered_suite/doctest.txt PASSED +src/zope/pytestlayer/tests/fixture/single_layered_suite/test_core.py <- test_suite: /src/zope/pytestlayer/tests/fixture/single_layered_suite/doctest.txt PASSED testTearDown foo Tear down single_layered_suite.test_core.FooLayer in N.NNN seconds. """ == join(lines) @@ -162,16 +163,16 @@ def test_single_layered_suite(where): def test_shared_with_layered_suite(where): lines = run_pytest('shared_with_layered_suite') assert """\ -plugins: gocept.pytestlayer +plugins: zope.pytestlayer collecting ... collected 2 items -src/gocept/pytestlayer/tests/fixture/shared_with_layered_suite/test_core.py:NN: FooTest.test_dummy shared_with_layered_suite.test_core.FooLayer +src/zope/pytestlayer/tests/fixture/shared_with_layered_suite/test_core.py:NN: FooTest.test_dummy shared_with_layered_suite.test_core.FooLayer Set up shared_with_layered_suite.test_core.FooLayer in N.NNN seconds. testSetUp foo -src/gocept/pytestlayer/tests/fixture/shared_with_layered_suite/test_core.py:NN: FooTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/shared_with_layered_suite/test_core.py:NN: FooTest.test_dummy PASSED testTearDown foo -src/gocept/pytestlayer/tests/fixture/shared_with_layered_suite/test_core.py <- test_suite: /src/gocept/pytestlayer/tests/fixture/shared_with_layered_suite/mydoctest.txt +src/zope/pytestlayer/tests/fixture/shared_with_layered_suite/test_core.py <- test_suite: /src/zope/pytestlayer/tests/fixture/shared_with_layered_suite/mydoctest.txt testSetUp foo -src/gocept/pytestlayer/tests/fixture/shared_with_layered_suite/test_core.py <- test_suite: /src/gocept/pytestlayer/tests/fixture/shared_with_layered_suite/mydoctest.txt PASSED +src/zope/pytestlayer/tests/fixture/shared_with_layered_suite/test_core.py <- test_suite: /src/zope/pytestlayer/tests/fixture/shared_with_layered_suite/mydoctest.txt PASSED testTearDown foo Tear down shared_with_layered_suite.test_core.FooLayer in N.NNN seconds. """ == join(lines) @@ -181,13 +182,13 @@ def test_shared_with_layered_suite(where): def test_with_and_without_layer(where): lines = run_pytest('with_and_without_layer') assert """\ -plugins: gocept.pytestlayer +plugins: zope.pytestlayer collecting ... collected 2 items -src/gocept/pytestlayer/tests/fixture/with_and_without_layer/test_core.py:NN: UnitTest.test_dummy PASSED -src/gocept/pytestlayer/tests/fixture/with_and_without_layer/test_core.py:NN: FooTest.test_dummy with_and_without_layer.test_core.FooLayer +src/zope/pytestlayer/tests/fixture/with_and_without_layer/test_core.py:NN: UnitTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/with_and_without_layer/test_core.py:NN: FooTest.test_dummy with_and_without_layer.test_core.FooLayer Set up with_and_without_layer.test_core.FooLayer in N.NNN seconds. testSetUp foo -src/gocept/pytestlayer/tests/fixture/with_and_without_layer/test_core.py:NN: FooTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/with_and_without_layer/test_core.py:NN: FooTest.test_dummy PASSED testTearDown foo Tear down with_and_without_layer.test_core.FooLayer in N.NNN seconds. """ == join(lines) @@ -197,18 +198,18 @@ def test_with_and_without_layer(where): def test_two_dependent_layers(where): lines = run_pytest('two_dependent_layers') assert """\ -plugins: gocept.pytestlayer +plugins: zope.pytestlayer collecting ... collected 2 items -src/gocept/pytestlayer/tests/fixture/two_dependent_layers/test_core.py:NN: FooTest.test_dummy two_dependent_layers.test_core.FooLayer +src/zope/pytestlayer/tests/fixture/two_dependent_layers/test_core.py:NN: FooTest.test_dummy two_dependent_layers.test_core.FooLayer Set up two_dependent_layers.test_core.FooLayer in N.NNN seconds. testSetUp foo -src/gocept/pytestlayer/tests/fixture/two_dependent_layers/test_core.py:NN: FooTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/two_dependent_layers/test_core.py:NN: FooTest.test_dummy PASSED testTearDown foo -src/gocept/pytestlayer/tests/fixture/two_dependent_layers/test_core.py:NN: BarTest.test_dummy two_dependent_layers.test_core.BarLayer +src/zope/pytestlayer/tests/fixture/two_dependent_layers/test_core.py:NN: BarTest.test_dummy two_dependent_layers.test_core.BarLayer Set up two_dependent_layers.test_core.BarLayer in N.NNN seconds. testSetUp foo testSetUp bar -src/gocept/pytestlayer/tests/fixture/two_dependent_layers/test_core.py:NN: BarTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/two_dependent_layers/test_core.py:NN: BarTest.test_dummy PASSED testTearDown bar testTearDown foo Tear down two_dependent_layers.test_core.BarLayer in N.NNN seconds. @@ -220,18 +221,18 @@ def test_two_dependent_layers(where): def test_two_dependent_layered_suites(where): lines = run_pytest('two_dependent_layered_suites') assert """\ -plugins: gocept.pytestlayer +plugins: zope.pytestlayer collecting ... collected 2 items -src/gocept/pytestlayer/tests/fixture/two_dependent_layered_suites/test_core.py <- test_suite: /src/gocept/pytestlayer/tests/fixture/two_dependent_layered_suites/foo.txt two_dependent_layered_suites.test_core.FooLayer +src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/test_core.py <- test_suite: /src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/foo.txt two_dependent_layered_suites.test_core.FooLayer Set up two_dependent_layered_suites.test_core.FooLayer in N.NNN seconds. testSetUp foo -src/gocept/pytestlayer/tests/fixture/two_dependent_layered_suites/test_core.py <- test_suite: /src/gocept/pytestlayer/tests/fixture/two_dependent_layered_suites/foo.txt PASSED +src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/test_core.py <- test_suite: /src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/foo.txt PASSED testTearDown foo -src/gocept/pytestlayer/tests/fixture/two_dependent_layered_suites/test_core.py <- test_suite: /src/gocept/pytestlayer/tests/fixture/two_dependent_layered_suites/bar.txt two_dependent_layered_suites.test_core.BarLayer +src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/test_core.py <- test_suite: /src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/bar.txt two_dependent_layered_suites.test_core.BarLayer Set up two_dependent_layered_suites.test_core.BarLayer in N.NNN seconds. testSetUp foo testSetUp bar -src/gocept/pytestlayer/tests/fixture/two_dependent_layered_suites/test_core.py <- test_suite: /src/gocept/pytestlayer/tests/fixture/two_dependent_layered_suites/bar.txt PASSED +src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/test_core.py <- test_suite: /src/zope/pytestlayer/tests/fixture/two_dependent_layered_suites/bar.txt PASSED testTearDown bar testTearDown foo Tear down two_dependent_layered_suites.test_core.BarLayer in N.NNN seconds. @@ -243,18 +244,18 @@ def test_two_dependent_layered_suites(where): def test_two_independent_layers(where): lines = run_pytest('two_independent_layers') assert """\ -plugins: gocept.pytestlayer +plugins: zope.pytestlayer collecting ... collected 2 items -src/gocept/pytestlayer/tests/fixture/two_independent_layers/test_core.py:NN: FooTest.test_dummy two_independent_layers.test_core.FooLayer +src/zope/pytestlayer/tests/fixture/two_independent_layers/test_core.py:NN: FooTest.test_dummy two_independent_layers.test_core.FooLayer Set up two_independent_layers.test_core.FooLayer in N.NNN seconds. testSetUp foo -src/gocept/pytestlayer/tests/fixture/two_independent_layers/test_core.py:NN: FooTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/two_independent_layers/test_core.py:NN: FooTest.test_dummy PASSED testTearDown foo Tear down two_independent_layers.test_core.FooLayer in N.NNN seconds. -src/gocept/pytestlayer/tests/fixture/two_independent_layers/test_core.py:NN: BarTest.test_dummy two_independent_layers.test_core.BarLayer +src/zope/pytestlayer/tests/fixture/two_independent_layers/test_core.py:NN: BarTest.test_dummy two_independent_layers.test_core.BarLayer Set up two_independent_layers.test_core.BarLayer in N.NNN seconds. testSetUp bar -src/gocept/pytestlayer/tests/fixture/two_independent_layers/test_core.py:NN: BarTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/two_independent_layers/test_core.py:NN: BarTest.test_dummy PASSED testTearDown bar Tear down two_independent_layers.test_core.BarLayer in N.NNN seconds. """ == join(lines) @@ -266,28 +267,28 @@ def test_two_independent_layers(where): def test_keep_layer_across_test_classes(where): lines = run_pytest('keep_layer_across_test_classes') assert """\ -plugins: gocept.pytestlayer +plugins: zope.pytestlayer collecting ... collected 3 items -src/gocept/pytestlayer/tests/fixture/keep_layer_across_test_classes/test_core.py:NN: FooTest.test_dummy order_by_layer.test_core.FooLayer +src/zope/pytestlayer/tests/fixture/keep_layer_across_test_classes/test_core.py:NN: FooTest.test_dummy order_by_layer.test_core.FooLayer Set up keep_layer_across_test_classes.test_core.FooLayer in N.NNN seconds. testSetUp foo -src/gocept/pytestlayer/tests/fixture/keep_layer_across_test_classes/test_core.py:NN: FooTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/keep_layer_across_test_classes/test_core.py:NN: FooTest.test_dummy PASSED testTearDown foo -src/gocept/pytestlayer/tests/fixture/keep_layer_across_test_classes/test_core.py:NN: FooBarTest.test_dummy order_by_layer.test_core.BarLayer +src/zope/pytestlayer/tests/fixture/keep_layer_across_test_classes/test_core.py:NN: FooBarTest.test_dummy order_by_layer.test_core.BarLayer Set up keep_layer_across_test_classes.test_core.FooBarLayer in N.NNN seconds. testSetUp foo testSetUp bar testSetUp foobar -src/gocept/pytestlayer/tests/fixture/keep_layer_across_test_classes/test_core.py:NN: FooBarTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/keep_layer_across_test_classes/test_core.py:NN: FooBarTest.test_dummy PASSED testTearDown foobar testTearDown bar testTearDown foo Tear down keep_layer_across_test_classes.test_core.FooBarLayer in N.NNN seconds. Tear down keep_layer_across_test_classes.test_core.FooLayer in N.NNN seconds. -src/gocept/pytestlayer/tests/fixture/keep_layer_across_test_classes/test_core.py:NN: BarTest.test_dummy order_by_layer.test_core.FooLayer +src/zope/pytestlayer/tests/fixture/keep_layer_across_test_classes/test_core.py:NN: BarTest.test_dummy order_by_layer.test_core.FooLayer Set up keep_layer_across_test_classes.test_core.BarLayer in N.NNN seconds. testSetUp bar -src/gocept/pytestlayer/tests/fixture/keep_layer_across_test_classes/test_core.py:NN: BarTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/keep_layer_across_test_classes/test_core.py:NN: BarTest.test_dummy PASSED testTearDown bar Tear down keep_layer_across_test_classes.test_core.BarLayer in N.NNN seconds. """ == join(lines) @@ -297,31 +298,31 @@ def test_keep_layer_across_test_classes(where): def test_order_by_layer(where): lines = run_pytest('order_by_layer') assert """\ -plugins: gocept.pytestlayer +plugins: zope.pytestlayer collecting ... collected 4 items -src/gocept/pytestlayer/tests/fixture/order_by_layer/test_core.py:NN: FooTest.test_dummy order_by_layer.test_core.FooLayer +src/zope/pytestlayer/tests/fixture/order_by_layer/test_core.py:NN: FooTest.test_dummy order_by_layer.test_core.FooLayer Set up order_by_layer.test_core.FooLayer in N.NNN seconds. testSetUp foo -src/gocept/pytestlayer/tests/fixture/order_by_layer/test_core.py:NN: FooTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/order_by_layer/test_core.py:NN: FooTest.test_dummy PASSED testTearDown foo Tear down order_by_layer.test_core.FooLayer in N.NNN seconds. -src/gocept/pytestlayer/tests/fixture/order_by_layer/test_core.py:NN: BarTest.test_dummy order_by_layer.test_core.BarLayer +src/zope/pytestlayer/tests/fixture/order_by_layer/test_core.py:NN: BarTest.test_dummy order_by_layer.test_core.BarLayer Set up order_by_layer.test_core.BarLayer in N.NNN seconds. testSetUp bar -src/gocept/pytestlayer/tests/fixture/order_by_layer/test_core.py:NN: BarTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/order_by_layer/test_core.py:NN: BarTest.test_dummy PASSED testTearDown bar -src/gocept/pytestlayer/tests/fixture/order_by_layer/test_core.py:NN: Bar2Test.test_dummy +src/zope/pytestlayer/tests/fixture/order_by_layer/test_core.py:NN: Bar2Test.test_dummy testSetUp bar -src/gocept/pytestlayer/tests/fixture/order_by_layer/test_core.py:NN: Bar2Test.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/order_by_layer/test_core.py:NN: Bar2Test.test_dummy PASSED testTearDown bar -src/gocept/pytestlayer/tests/fixture/order_by_layer/test_core.py:NN: FooBarTest.test_dummy order_by_layer.test_core.FooLayer +src/zope/pytestlayer/tests/fixture/order_by_layer/test_core.py:NN: FooBarTest.test_dummy order_by_layer.test_core.FooLayer Set up order_by_layer.test_core.FooLayer in N.NNN seconds. order_by_layer.test_core.FooBarLayer Set up order_by_layer.test_core.FooBarLayer in N.NNN seconds. testSetUp foo testSetUp bar testSetUp foobar -src/gocept/pytestlayer/tests/fixture/order_by_layer/test_core.py:NN: FooBarTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/order_by_layer/test_core.py:NN: FooBarTest.test_dummy PASSED testTearDown foobar testTearDown bar testTearDown foo @@ -335,43 +336,43 @@ def test_order_by_layer(where): def test_order_with_layered_suite(where): lines = run_pytest('order_with_layered_suite') assert """\ -plugins: gocept.pytestlayer +plugins: zope.pytestlayer collecting ... collected 6 items -src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: FooTest.test_dummy order_with_layered_suite.test_core.FooLayer +src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: FooTest.test_dummy order_with_layered_suite.test_core.FooLayer Set up order_with_layered_suite.test_core.FooLayer in N.NNN seconds. testSetUp foo -src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: FooTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: FooTest.test_dummy PASSED testTearDown foo -src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py <- test_suite: /src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/foo.txt +src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py <- test_suite: /src/zope/pytestlayer/tests/fixture/order_with_layered_suite/foo.txt testSetUp foo -src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py <- test_suite: /src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/foo.txt PASSED +src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py <- test_suite: /src/zope/pytestlayer/tests/fixture/order_with_layered_suite/foo.txt PASSED testTearDown foo Tear down order_with_layered_suite.test_core.FooLayer in N.NNN seconds. -src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: BarTest.test_dummy order_with_layered_suite.test_core.BarLayer +src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: BarTest.test_dummy order_with_layered_suite.test_core.BarLayer Set up order_with_layered_suite.test_core.BarLayer in N.NNN seconds. testSetUp bar -src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: BarTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: BarTest.test_dummy PASSED testTearDown bar -src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: Bar2Test.test_dummy +src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: Bar2Test.test_dummy testSetUp bar -src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: Bar2Test.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: Bar2Test.test_dummy PASSED testTearDown bar -src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: FooBarTest.test_dummy order_with_layered_suite.test_core.FooLayer +src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: FooBarTest.test_dummy order_with_layered_suite.test_core.FooLayer Set up order_with_layered_suite.test_core.FooLayer in N.NNN seconds. order_with_layered_suite.test_core.FooBarLayer Set up order_with_layered_suite.test_core.FooBarLayer in N.NNN seconds. testSetUp foo testSetUp bar testSetUp foobar -src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: FooBarTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: FooBarTest.test_dummy PASSED testTearDown foobar testTearDown bar testTearDown foo -src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py <- test_suite: /src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/foobar.txt +src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py <- test_suite: /src/zope/pytestlayer/tests/fixture/order_with_layered_suite/foobar.txt testSetUp foo testSetUp bar testSetUp foobar -src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py <- test_suite: /src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/foobar.txt PASSED +src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py <- test_suite: /src/zope/pytestlayer/tests/fixture/order_with_layered_suite/foobar.txt PASSED testTearDown foobar testTearDown bar testTearDown foo @@ -385,33 +386,33 @@ def test_order_with_layered_suite(where): def test_order_with_layered_suite_select_layer(where): lines = run_pytest('order_with_layered_suite', '-k', 'FooLayer') assert """\ -plugins: gocept.pytestlayer +plugins: zope.pytestlayer collecting ... collected 6 items / 2 deselected / 4 selected -src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: FooTest.test_dummy order_with_layered_suite.test_core.FooLayer +src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: FooTest.test_dummy order_with_layered_suite.test_core.FooLayer Set up order_with_layered_suite.test_core.FooLayer in N.NNN seconds. testSetUp foo -src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: FooTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: FooTest.test_dummy PASSED testTearDown foo -src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py <- test_suite: /src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/foo.txt +src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py <- test_suite: /src/zope/pytestlayer/tests/fixture/order_with_layered_suite/foo.txt testSetUp foo -src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py <- test_suite: /src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/foo.txt PASSED +src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py <- test_suite: /src/zope/pytestlayer/tests/fixture/order_with_layered_suite/foo.txt PASSED testTearDown foo -src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: FooBarTest.test_dummy order_with_layered_suite.test_core.BarLayer +src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: FooBarTest.test_dummy order_with_layered_suite.test_core.BarLayer Set up order_with_layered_suite.test_core.BarLayer in N.NNN seconds. order_with_layered_suite.test_core.FooBarLayer Set up order_with_layered_suite.test_core.FooBarLayer in N.NNN seconds. testSetUp foo testSetUp bar testSetUp foobar -src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: FooBarTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py:NN: FooBarTest.test_dummy PASSED testTearDown foobar testTearDown bar testTearDown foo -src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py <- test_suite: /src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/foobar.txt +src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py <- test_suite: /src/zope/pytestlayer/tests/fixture/order_with_layered_suite/foobar.txt testSetUp foo testSetUp bar testSetUp foobar -src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py <- test_suite: /src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/foobar.txt PASSED +src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py <- test_suite: /src/zope/pytestlayer/tests/fixture/order_with_layered_suite/foobar.txt PASSED testTearDown foobar testTearDown bar testTearDown foo @@ -425,9 +426,9 @@ def test_order_with_layered_suite_select_layer(where): def test_order_with_layered_suite_select_doctest(where): lines = run_pytest('order_with_layered_suite', '-k', 'foobar and txt') assert """\ -plugins: gocept.pytestlayer +plugins: zope.pytestlayer collecting ... collected 6 items / 5 deselected / 1 selected -src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py <- test_suite: /src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/foobar.txt order_with_layered_suite.test_core.FooLayer +src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py <- test_suite: /src/zope/pytestlayer/tests/fixture/order_with_layered_suite/foobar.txt order_with_layered_suite.test_core.FooLayer Set up order_with_layered_suite.test_core.FooLayer in N.NNN seconds. order_with_layered_suite.test_core.BarLayer Set up order_with_layered_suite.test_core.BarLayer in N.NNN seconds. @@ -436,7 +437,7 @@ def test_order_with_layered_suite_select_doctest(where): testSetUp foo testSetUp bar testSetUp foobar -src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py <- test_suite: /src/gocept/pytestlayer/tests/fixture/order_with_layered_suite/foobar.txt PASSED +src/zope/pytestlayer/tests/fixture/order_with_layered_suite/test_core.py <- test_suite: /src/zope/pytestlayer/tests/fixture/order_with_layered_suite/foobar.txt PASSED testTearDown foobar testTearDown bar testTearDown foo @@ -450,9 +451,9 @@ def test_order_with_layered_suite_select_doctest(where): def test_works_even_without_any_setup_or_teardown_methods(where): lines = run_pytest('no_setup_or_teardown') assert """\ -plugins: gocept.pytestlayer +plugins: zope.pytestlayer collecting ... collected 1 item -src/gocept/pytestlayer/tests/fixture/no_setup_or_teardown/test_core.py:NN: FooTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/no_setup_or_teardown/test_core.py:NN: FooTest.test_dummy PASSED """ == join(lines) assert '=== 1 passed' in lines[-1] @@ -468,15 +469,15 @@ def test_nice_error_message_if_layer_has_no_bases(where): def test_creating_different_fixtures_for_layers_with_the_same_name(where): lines = run_pytest('layers_with_same_name') assert """\ -plugins: gocept.pytestlayer +plugins: zope.pytestlayer collecting ... collected 2 items -src/gocept/pytestlayer/tests/fixture/layers_with_same_name/test_core.py:NN: FooTest.test_dummy layers_with_same_name.test_core.TestLayer +src/zope/pytestlayer/tests/fixture/layers_with_same_name/test_core.py:NN: FooTest.test_dummy layers_with_same_name.test_core.TestLayer Set up layers_with_same_name.test_core.TestLayer in N.NNN seconds. -src/gocept/pytestlayer/tests/fixture/layers_with_same_name/test_core.py:NN: FooTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/layers_with_same_name/test_core.py:NN: FooTest.test_dummy PASSED Tear down layers_with_same_name.test_core.TestLayer in N.NNN seconds. -src/gocept/pytestlayer/tests/fixture/layers_with_same_name/test_core.py:NN: BarTest.test_dummy layers_with_same_name.test_core.TestLayer +src/zope/pytestlayer/tests/fixture/layers_with_same_name/test_core.py:NN: BarTest.test_dummy layers_with_same_name.test_core.TestLayer Set up layers_with_same_name.test_core.TestLayer in N.NNN seconds. -src/gocept/pytestlayer/tests/fixture/layers_with_same_name/test_core.py:NN: BarTest.test_dummy PASSED +src/zope/pytestlayer/tests/fixture/layers_with_same_name/test_core.py:NN: BarTest.test_dummy PASSED Tear down layers_with_same_name.test_core.TestLayer in N.NNN seconds. """ == join(lines) assert '=== 2 passed' in lines[-1] @@ -490,16 +491,16 @@ def test_selection_of_doctest_names(where): def test_fixture_create_allows_overriding_names(where): lines = run_pytest('custom_fixture_name') assert """\ -plugins: gocept.pytestlayer +plugins: zope.pytestlayer collecting ... collected 2 items -src/gocept/pytestlayer/tests/fixture/custom_fixture_name/test_core.py:NN: test_can_access_layer_via_fixture custom_fixture_name.test_core.FooLayer +src/zope/pytestlayer/tests/fixture/custom_fixture_name/test_core.py:NN: test_can_access_layer_via_fixture custom_fixture_name.test_core.FooLayer Set up custom_fixture_name.test_core.FooLayer in N.NNN seconds. testSetUp foo -src/gocept/pytestlayer/tests/fixture/custom_fixture_name/test_core.py:NN: test_can_access_layer_via_fixture PASSED +src/zope/pytestlayer/tests/fixture/custom_fixture_name/test_core.py:NN: test_can_access_layer_via_fixture PASSED testTearDown foo -src/gocept/pytestlayer/tests/fixture/custom_fixture_name/test_core.py:NN: FooTest.test_accesses_fixture_with_generated_name_for_layer +src/zope/pytestlayer/tests/fixture/custom_fixture_name/test_core.py:NN: FooTest.test_accesses_fixture_with_generated_name_for_layer testSetUp foo -src/gocept/pytestlayer/tests/fixture/custom_fixture_name/test_core.py:NN: FooTest.test_accesses_fixture_with_generated_name_for_layer PASSED +src/zope/pytestlayer/tests/fixture/custom_fixture_name/test_core.py:NN: FooTest.test_accesses_fixture_with_generated_name_for_layer PASSED testTearDown foo Tear down custom_fixture_name.test_core.FooLayer in N.NNN seconds. """ == join(lines) @@ -509,14 +510,14 @@ def test_fixture_create_allows_overriding_names(where): def test_if_session_fixture_is_used_class_fixtures_are_ignored(where): lines = run_pytest('session_fixture') assert """\ -plugins: gocept.pytestlayer +plugins: zope.pytestlayer collecting ... collected 2 items -src/gocept/pytestlayer/tests/fixture/session_fixture/test_core.py:NN: test_can_access_layer_via_fixture session_fixture.test_core.FooLayer +src/zope/pytestlayer/tests/fixture/session_fixture/test_core.py:NN: test_can_access_layer_via_fixture session_fixture.test_core.FooLayer Set up session_fixture.test_core.FooLayer in N.NNN seconds. -src/gocept/pytestlayer/tests/fixture/session_fixture/test_core.py:NN: test_can_access_layer_via_fixture PASSED -src/gocept/pytestlayer/tests/fixture/session_fixture/test_core.py:NN: FooTest.test_accesses_fixture_with_generated_name_for_layer +src/zope/pytestlayer/tests/fixture/session_fixture/test_core.py:NN: test_can_access_layer_via_fixture PASSED +src/zope/pytestlayer/tests/fixture/session_fixture/test_core.py:NN: FooTest.test_accesses_fixture_with_generated_name_for_layer testSetUp foo -src/gocept/pytestlayer/tests/fixture/session_fixture/test_core.py:NN: FooTest.test_accesses_fixture_with_generated_name_for_layer PASSED +src/zope/pytestlayer/tests/fixture/session_fixture/test_core.py:NN: FooTest.test_accesses_fixture_with_generated_name_for_layer PASSED testTearDown foo Tear down session_fixture.test_core.FooLayer in N.NNN seconds. """ == join(lines) diff --git a/src/gocept/pytestlayer/tests/test_layer.py b/src/zope/pytestlayer/tests/test_layer.py similarity index 63% rename from src/gocept/pytestlayer/tests/test_layer.py rename to src/zope/pytestlayer/tests/test_layer.py index 3275a5b..5617536 100644 --- a/src/gocept/pytestlayer/tests/test_layer.py +++ b/src/zope/pytestlayer/tests/test_layer.py @@ -1,4 +1,4 @@ -from gocept.pytestlayer import fixture +from zope.pytestlayer import fixture class LayerClass(object): @@ -9,5 +9,5 @@ class LayerClass(object): def test_get_layer_name_accounts_layers_importable_by_an_arbitrary_name(): - assert 'gocept.pytestlayer.tests.test_layer.layer' == \ + assert 'zope.pytestlayer.tests.test_layer.layer' == \ fixture.get_layer_name(layer) diff --git a/tox.ini b/tox.ini index d074d41..093653d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,28 +1,109 @@ +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/pure-python [tox] +minversion = 3.18 envlist = - py37, - py38, - py39, - py310, - py311, - pypy3, - coverage, -minversion = 2.4 + release-check + lint + py37 + py38 + py39 + py310 + py311 + py312 + pypy3 + docs + coverage [testenv] -usedevelop = True -extras = test +usedevelop = true +package = wheel +wheel_build_env = .pkg deps = pytest + pytest-cov pytest-remove-stale-bytecode -commands = pytest [] +setenv = + py312: VIRTUALENV_PIP=23.1.2 + py312: PIP_REQUIRE_VIRTUALENV=0 +commands = + pytest [] +extras = + test +[testenv:release-check] +description = ensure that the distribution is ready to release +basepython = python3 +skip_install = true +deps = + twine + build + check-manifest + check-python-versions >= 0.20.0 + wheel +commands_pre = +commands = + check-manifest + check-python-versions --only setup.py,tox.ini,.github/workflows/tests.yml + python -m build --sdist --no-isolation + twine check dist/* + +[testenv:lint] +basepython = python3 +skip_install = true +deps = + isort + flake8 +commands = + isort --check-only --diff {toxinidir}/src {toxinidir}/setup.py + flake8 src setup.py + +[testenv:isort-apply] +basepython = python3 +skip_install = true +commands_pre = +deps = + isort +commands = + isort {toxinidir}/src {toxinidir}/setup.py [] + +[testenv:docs] +basepython = python3 +skip_install = false +extras = + docs +commands_pre = +commands = + sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html [testenv:coverage] basepython = python3 +allowlist_externals = + mkdir deps = - {[testenv]deps} - pytest-cov coverage - coverage-python-version + pytest + pytest-cov + pytest-remove-stale-bytecode commands = + mkdir -p {toxinidir}/parts/htmlcov pytest --cov=src --cov-report=html [] + coverage html --ignore-errors + coverage report --ignore-errors --show-missing --fail-under=98 + +[coverage:run] +branch = True +source = zope.pytestlayer + +[coverage:report] +precision = 2 +exclude_lines = + pragma: no cover + pragma: nocover + except ImportError: + raise NotImplementedError + if __name__ == '__main__': + self.fail + raise AssertionError + +[coverage:html] +directory = parts/htmlcov