Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pytest-metadata for openSUSE:Factory checked in at 2023-07-25 11:51:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pytest-metadata (Old) and /work/SRC/openSUSE:Factory/.python-pytest-metadata.new.1467 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pytest-metadata" Tue Jul 25 11:51:25 2023 rev:7 rq:1100450 version:3.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pytest-metadata/python-pytest-metadata.changes 2023-05-10 16:18:54.551111245 +0200 +++ /work/SRC/openSUSE:Factory/.python-pytest-metadata.new.1467/python-pytest-metadata.changes 2023-07-25 11:53:17.182219428 +0200 @@ -1,0 +2,9 @@ +Mon Jul 24 19:09:25 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 3.0.0: + * Group CLI options + * Switch to Hatch + * Use `pytest.stash` internally instead of `_metadata` + * Simplify code + +------------------------------------------------------------------- Old: ---- pytest_metadata-2.0.4.tar.gz New: ---- pytest_metadata-3.0.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pytest-metadata.spec ++++++ --- /var/tmp/diff_new_pack.GrqZZp/_old 2023-07-25 11:53:19.282231724 +0200 +++ /var/tmp/diff_new_pack.GrqZZp/_new 2023-07-25 11:53:19.286231747 +0200 @@ -18,12 +18,13 @@ %{?sle15_python_module_pythons} Name: python-pytest-metadata -Version: 2.0.4 +Version: 3.0.0 Release: 0 Summary: Pytest plugin for test session metadata License: MPL-2.0 URL: https://github.com/pytest-dev/pytest-metadata Source: https://files.pythonhosted.org/packages/source/p/pytest-metadata/pytest_metadata-%{version}.tar.gz +BuildRequires: %{python_module hatch_vcs} BuildRequires: %{python_module pip} BuildRequires: %{python_module poetry-core} BuildRequires: %{python_module wheel} ++++++ pytest_metadata-2.0.4.tar.gz -> pytest_metadata-3.0.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest_metadata-2.0.4/.gitignore new/pytest_metadata-3.0.0/.gitignore --- old/pytest_metadata-2.0.4/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/pytest_metadata-3.0.0/.gitignore 2023-05-27 20:29:13.000000000 +0200 @@ -0,0 +1,10 @@ +__pycache__ +__version.py +*.egg-info/ +*.pyc +.cache +.eggs +.tox + +build +dist diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest_metadata-2.0.4/.pre-commit-config.yaml new/pytest_metadata-3.0.0/.pre-commit-config.yaml --- old/pytest_metadata-2.0.4/.pre-commit-config.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/pytest_metadata-3.0.0/.pre-commit-config.yaml 2023-05-27 20:29:13.000000000 +0200 @@ -0,0 +1,20 @@ +repos: + - repo: https://github.com/psf/black + rev: 23.3.0 + hooks: + - id: black + args: [--safe, --quiet] + language_version: python3 + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + + - repo: https://github.com/PyCQA/flake8 + rev: 6.0.0 + hooks: + - id: flake8 + exclude: docs + language_version: python3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest_metadata-2.0.4/AUTHORS new/pytest_metadata-3.0.0/AUTHORS --- old/pytest_metadata-2.0.4/AUTHORS 1970-01-01 01:00:00.000000000 +0100 +++ new/pytest_metadata-3.0.0/AUTHORS 2023-05-27 20:29:13.000000000 +0200 @@ -0,0 +1,8 @@ +AgustÃn Herranz +Arminius (numirias) +Dave Hunt +Imran Mumtaz +Jim Brännlund +Sam Clements +Tomas Krizek +Zac Hatfield-Dodds diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest_metadata-2.0.4/CHANGES.rst new/pytest_metadata-3.0.0/CHANGES.rst --- old/pytest_metadata-2.0.4/CHANGES.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/pytest_metadata-3.0.0/CHANGES.rst 2023-05-27 20:29:13.000000000 +0200 @@ -0,0 +1,143 @@ +Release Notes +------------- + +3.0.0 (2023-05-27) +------------------ + +* Group CLI options + + * Thanks to `@xmuskrat <https://github.com/xmuskrat>`_ for reporting. + +* Switch to Hatch + +* Use `pytest.stash` internally instead of `_metadata` + +* Simplify code + + * Thanks to `@LieYangGH <https://github.com/LeiYangGH>`_ for the PR. + +2.0.4 (2022-10-30) +------------------ + +* Fix deprecated `pytest.mark.optionalhook` marker. + +2.0.3 (2022-10-26) +------------------ + +* Remove `py` dependency + + * Thanks to `@Czaki <https://github.com/Czaki>`_ for reporting. + +2.0.2 (2022-07-15) +------------------ + +* Allow all python versions above 3.7 + +2.0.1 (2022-03-26) +------------------ + +* Fix issues with switching to pyproject.toml + + * Thanks to `@dvzrv <https://github.com/dvzrv>`_ and `@eltrufas <https://github.com/eltrufas>`_ for raising issues and providing fixes. + +2.0.0 (2022-03-22) +------------------ + +* Drop support for python 2.7 and 3.6 + +* Add support for python 3.9 and 3.10 + +* Introduce pyproject.toml + +* Provide metadata via JSON file + + * Thanks to `@digitalorder <https://github.com/digitalorder>`_ for the PR + +1.11.0 (2020-11-72) +------------------- + +* Provide a session fixture to include metadata in Junit XMLs as property tags. + + * Thanks to `@sanga <https://github.com/sanga>`_ for the PR + +1.10.0 (2020-06-24) +------------------ + +* Compatible with ``pytest-xdist`` 1.22.3+, now including 2.0+ + + * Thanks to `@Zac-HD <https://github.com/Zac-HD>`_ for the PR + +1.9.0 (2020-04-03) +------------------ + +* Add ``--metadata-from-json`` argument to support passing metadata as json. + + * Thanks to `@ImXron <https://github.com/ImXron>`_ for the PR + +* Add support for python 3.8. + + * Thanks to `@hugovk <https://github.com/hugovk>`_ for the PR + +* Remove always-masked GitLab environment variables. + + * Thanks to `@borntyping <https://github.com/borntyping>`_ for the PR + +1.8.0 (2019-01-03) +------------------ + +* Add environment variables for Bitbucket pipelines (CI). + +1.7.0 (2018-04-05) +------------------ + +* Add hook for modifying metadata. + + * Thanks to `@j19sch <https://github.com/j19sch>`_ for the PR + +1.6.0 (2018-02-21) +------------------ + +* Only show metadata in console when ``--verbose`` is specified. + +1.5.1 (2017-11-28) +------------------ + +* Support latest versions of pytest, which no longer vendor pluggy. + +1.5.0 (2017-05-15) +------------------ + +* Add environment variables for GitLab CI. + + * Thanks to `@tinproject <https://github.com/tinproject>`_ for the PR + +1.4.0 (2017-05-04) +------------------ + +* Allow additional metadata to be specified on the command-line. + + * Thanks to `@BeyondEvil <https://github.com/BeyondEvil>`_ for the PR + +1.3.0 (2017-03-01) +------------------ + +* Display initial metadata in report header. +* Update metadata when running with xdist processes instead of overwriting. + +1.2.0 (2017-02-24) +------------------ + +* Added environment variables for AppVeyor and CircleCI. +* Try to run ``pytest_configure`` first so that other plugins can contribute to + the metadata. + +1.1.0 (2017-02-16) +------------------ + +* Moved pytest related packages into 'Packages' as a dictionary. +* Changed installed plugins from a list to a dictionary. + +1.0.0 (2017-02-16) +------------------ + +* Initial release diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest_metadata-2.0.4/PKG-INFO new/pytest_metadata-3.0.0/PKG-INFO --- old/pytest_metadata-2.0.4/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/pytest_metadata-3.0.0/PKG-INFO 2023-05-27 20:29:13.000000000 +0200 @@ -1,31 +1,40 @@ Metadata-Version: 2.1 Name: pytest-metadata -Version: 2.0.4 +Version: 3.0.0 Summary: pytest plugin for test session metadata -Home-page: https://github.com/pytest-dev/pytest-metadata -License: MPL-2.0 -Keywords: pytest,metadata -Author: Dave Hunt -Author-email: dh...@mozilla.com -Requires-Python: >=3.7,<4.0 +Project-URL: Homepage, https://github.com/pytest-dev/pytest-metadata +Project-URL: Tracker, https://github.com/pytest-dev/pytest-metadata/issues +Project-URL: Source, https://github.com/pytest-dev/pytest-metadata +Author-email: Dave Hunt <dh...@mozilla.com>, Jim Brannlund <jimbrannl...@fastmail.com> +License-Expression: MPL-2.0 +License-File: AUTHORS +License-File: LICENSE +Keywords: metadata,pytest Classifier: Development Status :: 5 - Production/Stable Classifier: Framework :: Pytest Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved +Classifier: License :: OSI Approved :: MIT License +Classifier: Natural Language :: English Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: Microsoft :: Windows Classifier: Operating System :: POSIX -Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Topic :: Software Development :: Quality Assurance Classifier: Topic :: Software Development :: Testing Classifier: Topic :: Utilities -Requires-Dist: pytest (>=3.0.0,<8.0.0) -Project-URL: Repository, https://github.com/pytest-dev/pytest-metadata +Requires-Python: >=3.7 +Requires-Dist: pytest>=7.0.0 +Provides-Extra: test +Requires-Dist: black>=22.1.0; extra == 'test' +Requires-Dist: flake8>=4.0.1; extra == 'test' +Requires-Dist: pre-commit>=2.17.0; extra == 'test' +Requires-Dist: tox>=3.24.5; extra == 'test' Description-Content-Type: text/x-rst pytest-metadata @@ -181,7 +190,7 @@ .. code-block:: python import pytest - @pytest.mark.optionalhook + @pytest.hookimpl(optionalhook=True) def pytest_metadata(metadata): metadata.pop("password", None) @@ -193,14 +202,16 @@ def test_metadata(metadata): assert 'metadata' in metadata['Plugins'] -To access the metadata from a plugin, you can use the ``_metadata`` attribute of +To access the metadata from a plugin, you can use the ``stash`` attribute of the ``config`` object. This can be used to read/add/modify the metadata: .. code-block:: python def pytest_configure(config): - if hasattr(config, '_metadata'): - config._metadata['foo'] = 'bar' + metadata = config.pluginmanager.getplugin("metadata") + if metadata: + from pytest_metadata.plugin import metadata_key + config.stash[metadata_key]['foo'] = 'bar' Plugin integrations ------------------- @@ -222,4 +233,3 @@ - `Release Notes <http://github.com/davehunt/pytest-metadata/blob/master/CHANGES.rst>`_ - `Issue Tracker <http://github.com/davehunt/pytest-metadata/issues>`_ - `Code <http://github.com/davehunt/pytest-metadata/>`_ - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest_metadata-2.0.4/README.rst new/pytest_metadata-3.0.0/README.rst --- old/pytest_metadata-2.0.4/README.rst 2022-10-30 22:14:24.004578800 +0100 +++ new/pytest_metadata-3.0.0/README.rst 2023-05-27 20:29:13.000000000 +0200 @@ -151,7 +151,7 @@ .. code-block:: python import pytest - @pytest.mark.optionalhook + @pytest.hookimpl(optionalhook=True) def pytest_metadata(metadata): metadata.pop("password", None) @@ -163,14 +163,16 @@ def test_metadata(metadata): assert 'metadata' in metadata['Plugins'] -To access the metadata from a plugin, you can use the ``_metadata`` attribute of +To access the metadata from a plugin, you can use the ``stash`` attribute of the ``config`` object. This can be used to read/add/modify the metadata: .. code-block:: python def pytest_configure(config): - if hasattr(config, '_metadata'): - config._metadata['foo'] = 'bar' + metadata = config.pluginmanager.getplugin("metadata") + if metadata: + from pytest_metadata.plugin import metadata_key + config.stash[metadata_key]['foo'] = 'bar' Plugin integrations ------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest_metadata-2.0.4/development.rst new/pytest_metadata-3.0.0/development.rst --- old/pytest_metadata-2.0.4/development.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/pytest_metadata-3.0.0/development.rst 2023-05-27 20:29:13.000000000 +0200 @@ -0,0 +1,61 @@ +Development +=========== + +To contribute to `pytest-metadata` you can use `Hatch <https://hatch.pypa.io/latest/>`_ to manage +a python virtual environment and `pre-commit <https://pre-commit.com/>`_ to help you with +styling and formatting. + +To setup the virtual environment and pre-commit, run: + +.. code-block:: bash + + $ hatch -e test run pre-commit install + +If you're not using ``Hatch``, to install ``pre-commit``, run: + +.. code-block:: bash + + $ pip install pre-commit + $ pre-commit install + + +Automated Testing +----------------- + +All pull requests and merges are tested in `GitHub Actions <https://docs.github.com/en/actions>`_ +based on the workflows defined in ``.github/workflows``. + +Running Tests +------------- + +You will need `Tox <https://tox.wiki/en/latest/>`_ installed to run the tests +against the supported Python versions. If you're using ``Hatch`` it will be +installed for you. + +With ``Hatch``, run: + +.. code-block:: bash + + $ hatch -e test run tox + +Otherwise, to install and run, do: + +.. code-block:: bash + + $ pip install tox + $ tox + +Releasing a new version +----------------------- + +Follow these steps to release a new version of the project: + +#. Update your local master with the upstream master (``git pull --rebase upstream master``) +#. Create a new branch and update ``CHANGES.rst`` with the new version, today's date, and all changes/new features +#. Update ``pyproject.toml`` with the new version +#. Commit and push the new branch and then create a new pull request +#. Wait for tests and reviews and then merge the branch +#. Once merged, update your local master again (``git pull --rebase upstream master``) +#. Tag the release with the new release version (``git tag <new tag>``) +#. Push the tag (``git push upstream --tags``) +#. Done. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest_metadata-2.0.4/pyproject.toml new/pytest_metadata-3.0.0/pyproject.toml --- old/pytest_metadata-2.0.4/pyproject.toml 2022-10-30 22:14:24.004578800 +0100 +++ new/pytest_metadata-3.0.0/pyproject.toml 2023-05-27 20:29:13.000000000 +0200 @@ -1,53 +1,79 @@ [build-system] -requires = ["poetry-core>=1.0.0"] -build-backend = "poetry.core.masonry.api" +build-backend = "hatchling.build" +requires = [ + "hatch-vcs>=0.3", + "hatchling>=1.13", +] -[tool.poetry] +[project] name = "pytest-metadata" -version = "2.0.4" description = "pytest plugin for test session metadata" -license = "MPL-2.0" -authors = [ - "Dave Hunt <dh...@mozilla.com>", - "Jim Brännlund <jimbrannl...@fastmail.com>" -] readme = "README.rst" -homepage = "https://github.com/pytest-dev/pytest-metadata" -repository = "https://github.com/pytest-dev/pytest-metadata" +license = "MPL-2.0" +requires-python = ">=3.7" keywords = [ "pytest", - "metadata" + "metadata", +] +authors = [ + { name = "Dave Hunt", email = "dh...@mozilla.com" }, + { name = "Jim Brannlund", email = "jimbrannl...@fastmail.com" }, ] classifiers = [ - "Development Status :: 5 - Production/Stable", - "Framework :: Pytest", - "Intended Audience :: Developers", - "Operating System :: POSIX", - "Operating System :: Microsoft :: Windows", - "Operating System :: MacOS :: MacOS X", - "Topic :: Software Development :: Quality Assurance", - "Topic :: Software Development :: Testing", - "Topic :: Utilities", -] -packages = [ - { include = "pytest_metadata", from = "src" }, -] -include = [ - { path = "tests", format = "sdist" }, -] - -[tool.poetry.dependencies] -python = "^3.7" -pytest = ">=3.0.0,<8.0.0" - -[tool.poetry.dev-dependencies] -black = "^22.1.0" -flake8 = "^4.0.1" -tox = "^3.24.5" -pre-commit = "^2.17.0" + "Development Status :: 5 - Production/Stable", + "Framework :: Pytest", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Operating System :: POSIX", + "Operating System :: Microsoft :: Windows", + "Operating System :: MacOS :: MacOS X", + "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 :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Topic :: Software Development :: Quality Assurance", + "Topic :: Software Development :: Testing", + "Topic :: Utilities", +] +dependencies = [ + "pytest>=7.0.0", +] +dynamic = [ + "version", +] + +[project.optional-dependencies] +test = [ + "black>=22.1.0", + "flake8>=4.0.1", + "pre-commit>=2.17.0", + "tox>=3.24.5", +] -[tool.poetry.plugins.pytest11] +[project.urls] +Homepage = "https://github.com/pytest-dev/pytest-metadata" +Tracker = "https://github.com/pytest-dev/pytest-metadata/issues" +Source = "https://github.com/pytest-dev/pytest-metadata" + +[project.entry-points.pytest11] metadata = 'pytest_metadata.plugin' -[tool.black] -target-version = ['py37'] +[tool.hatch.envs.test] +features = [ + "test", +] + +[tool.hatch.version] +source = "vcs" + +[tool.hatch.build.targets.sdist] +exclude = [ + "/.github", +] + +[tool.hatch.build.hooks.vcs] +version-file = "src/pytest_metadata/__version.py" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest_metadata-2.0.4/setup.py new/pytest_metadata-3.0.0/setup.py --- old/pytest_metadata-2.0.4/setup.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pytest_metadata-3.0.0/setup.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,38 +0,0 @@ -# -*- coding: utf-8 -*- -from setuptools import setup - -package_dir = \ -{'': 'src'} - -packages = \ -['pytest_metadata', 'pytest_metadata.ci'] - -package_data = \ -{'': ['*']} - -install_requires = \ -['pytest>=3.0.0,<8.0.0'] - -entry_points = \ -{'pytest11': ['metadata = pytest_metadata.plugin']} - -setup_kwargs = { - 'name': 'pytest-metadata', - 'version': '2.0.4', - 'description': 'pytest plugin for test session metadata', - 'long_description': 'pytest-metadata\n===============\n\npytest-metadata is a plugin for `pytest <http://pytest.org>`_ that provides\naccess to test session metadata.\n\n.. image:: https://img.shields.io/badge/license-MPL%202.0-blue.svg\n :target: https://github.com/pytest-dev/pytest-metadata/blob/master/LICENSE\n :alt: License\n.. image:: https://img.shields.io/pypi/v/pytest-metadata.svg\n :target: https://pypi.python.org/pypi/pytest-metadata/\n :alt: PyPI\n.. image:: https://img.shields.io/travis/pytest-dev/pytest-metadata.svg\n :target: https://travis-ci.org/pytest-dev/pytest-metadata/\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/ambv/black\n :alt: Travis\n.. image:: https://img.shields.io/github/issues-raw/pytest-dev/pytest-metadata.svg\n :target: https://github.com/pytest-dev/pytest-metadata/issues\n :alt: Issues\n.. image:: https://img.shields.io/requires/github/pytest-dev/pytest-metadata.svg\n :ta rget: https://requires.io/github/pytest-dev/pytest-metadata/requirements/?branch=master\n :alt: Requirements\n\nRequirements\n------------\n\nYou will need the following in order to use pytest-metadata:\n\n- Python 3.7+ or PyPy3\n\nInstallation\n------------\n\nTo install pytest-metadata:\n\n.. code-block:: bash\n\n $ pip install pytest-metadata\n\nContributing\n------------\n\nWe welcome contributions.\n\nTo learn more, see `Development <https://github.com/pytest-dev/pytest-metadata/blob/master/development.rst>`_\n\nAvailable metadata\n------------------\n\nThe following metadata is gathered by this plugin:\n\n======== =============== ===================================\nKey Description Example\n======== =============== ===================================\nPython Python version 3.6.4\nPlatform Platform Darwin-17.4.0-x86_64-i386-64bit\nPackages pytest packages {\'py\': \'1.5.2\', \'pytest\': \'3.4.1\'}\nPlugins pytest plugins {\'metadata\': \'1.6.0\'}\ n======== =============== ===================================\n\nAdditional metadata\n-------------------\n\nYou can provide your own metadata (key, value pair) by specifying ``--metadata`` on the commandline::\n\n pytest --metadata foo bar\n\nNote: You can provide multiple sets of ``--metadata``::\n\n pytest --metadata foo bar --metadata baz zoo\n\nThere\'s also the possibility of passing in metadata as a JSON string::\n\n pytest --metadata-from-json \'{"cat_says": "bring the cat nip", "human_says": "yes kitty"}\'\n\nAlternatively a JSON can be read from a given file::\n\n pytest --metadata-from-json-file path/to/valid/file.json\n\nContinuous integration\n----------------------\n\nWhen run in a continuous integration environment, additional metadata is added\nfrom environment variables. Below is a list of the supported continuous\nintegration providers, along with links to the environment variables that are\nadded to metadata if they\'re present.\n\n* `AppVeyor <https:// www.appveyor.com/docs/environment-variables/>`_\n* `Bitbucket <https://confluence.atlassian.com/bitbucket/environment-variables-794502608.html>`_\n* `CircleCI <https://circleci.com/docs/1.0/environment-variables/>`_\n* `GitLab CI <http://docs.gitlab.com/ce/ci/variables/README.html>`_\n* `Jenkins <https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-JenkinsSetEnvironmentVariables>`_\n* `TaskCluster <https://docs.taskcluster.net/reference/workers/docker-worker/environment>`_\n* `Travis CI <https://docs.travis-ci.com/user/environment-variables/>`_\n\nNote that if you\'re using `Tox <http://tox.readthedocs.io/>`_ to run your tests\nthen you will need to `pass down any additional environment variables <http://tox.readthedocs.io/en/latest/example/basic.html#passing-down-environment-variables>`_\nfor these to be picked up.\n\nViewing metadata\n----------------\n\nIf you pass ``--verbose`` on the command line when running your tests, then the\nmet adata will be displayed in the terminal report header::\n\n pytest --verbose\n ============================ test session starts ============================\n platform darwin -- Python 3.6.4, pytest-3.4.1, py-1.5.2, pluggy-0.6.0 -- /usr/bin/python\n cachedir: .pytest_cache\n metadata: {\'Python\': \'3.6.4\', \'Platform\': \'Darwin-17.4.0-x86_64-i386-64bit\', \'Packages\': {\'pytest\': \'3.4.1\', \'py\': \'1.5.2\', \'pluggy\': \'0.6.0\'}, \'Plugins\': {\'metadata\': \'1.6.0\'}}\n plugins: metadata-1.6.0\n\nIncluding metadata in Junit XML\n-------------------------------\n\nPytest-metadata provides the session scoped fixture :code:`include_metadata_in_junit_xml` that you may use to include any metadata in Junit XML as ``property`` tags.\nFor example the following test module\n\n.. code-block:: python\n\n import pytest\n\n pytestmark = pytest.mark.usefixtures(\'include_metadata_in_junit_xml\')\n\n def test():\n pass\n\nwhen called with\n\n.. code-block:: bash\n\n pytest --metadata Daffy Duck --junit-xml=results.xml\n\nwould produce the following XML\n\n.. code-block:: xml\n\n <?xml version="1.0" encoding="utf-8"?>\n <testsuites>\n <testsuite name="pytest" errors="0" failures="0" skipped="0" tests="1" time="0.009" timestamp="2020-11-27T06:38:44.407674" hostname="sam">\n <properties>\n <property name="Daffy" value="Duck"/>\n ...\n\nAccessing metadata\n------------------\n\nTo add/modify/delete metadata at the end of metadata collection, you can use the ``pytest_metadata`` hook:\n\n.. code-block:: python\n\n import pytest\n @pytest.mark.optionalhook\n def pytest_metadata(metadata):\n metadata.pop("password", None)\n\nTo access the metadata from a test or fixture, you can use the ``metadata``\nfixture:\n\n.. code-block:: python\n\n def test_metadata(metadata):\n assert \'metadata\' in metadata[\'Plugins\']\n\nTo access the metadata from a plugin, you can use the ``_metadata`` attribute of\nthe ``config`` object. This can be used to read/add/modify the metadata:\n\n.. code-block:: python\n\n def pytest_configure(config):\n if hasattr(config, \'_metadata\'):\n config._metadata[\'foo\'] = \'bar\'\n\nPlugin integrations\n-------------------\n\nHere\'s a handy list of plugins that either read or contribute to the metadata:\n\n* `pytest-base-url <https://pypi.python.org/pypi/pytest-base-url/>`_ - Adds the\n base URL to the metadata.\n* `pytest-html <https://pypi.python.org/pypi/pytest-html/>`_ - Displays the\n metadata at the start of each report.\n* `pytest-reporter-html1 <https://pypi.org/project/pytest-reporter-html1/>`_ -\n Presents metadata as part of the report.\n* `pytest-selenium <https://pypi.python.org/pypi/pytest-selenium/>`_ - Adds the\n driver, capabilities, and remote server to the metadata.\n\nResources\n---------\n\n- `Release Notes <http://github.com/davehunt/pytest-metadata/blob/master/CHANGES.rst>`_\n- `Issue Tracker <http://github.com/davehunt/pytest-metadata/issues>`_\ n- `Code <http://github.com/davehunt/pytest-metadata/>`_\n', - 'author': 'Dave Hunt', - 'author_email': 'dh...@mozilla.com', - 'maintainer': 'None', - 'maintainer_email': 'None', - 'url': 'https://github.com/pytest-dev/pytest-metadata', - 'package_dir': package_dir, - 'packages': packages, - 'package_data': package_data, - 'install_requires': install_requires, - 'entry_points': entry_points, - 'python_requires': '>=3.7,<4.0', -} - - -setup(**setup_kwargs) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest_metadata-2.0.4/src/pytest_metadata/__version.py new/pytest_metadata-3.0.0/src/pytest_metadata/__version.py --- old/pytest_metadata-2.0.4/src/pytest_metadata/__version.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pytest_metadata-3.0.0/src/pytest_metadata/__version.py 2023-05-27 20:29:13.000000000 +0200 @@ -0,0 +1,4 @@ +# file generated by setuptools_scm +# don't change, don't track in version control +__version__ = version = '3.0.0' +__version_tuple__ = version_tuple = (3, 0, 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest_metadata-2.0.4/src/pytest_metadata/hooks.py new/pytest_metadata-3.0.0/src/pytest_metadata/hooks.py --- old/pytest_metadata-2.0.4/src/pytest_metadata/hooks.py 2022-10-30 22:14:24.004578800 +0100 +++ new/pytest_metadata-3.0.0/src/pytest_metadata/hooks.py 2023-05-27 20:29:13.000000000 +0200 @@ -3,5 +3,5 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. -def pytest_metadata(metadata): +def pytest_metadata(metadata, config): """Called after collecting metadata""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest_metadata-2.0.4/src/pytest_metadata/plugin.py new/pytest_metadata-3.0.0/src/pytest_metadata/plugin.py --- old/pytest_metadata-2.0.4/src/pytest_metadata/plugin.py 2022-10-30 22:14:24.004578800 +0100 +++ new/pytest_metadata-3.0.0/src/pytest_metadata/plugin.py 2023-05-27 20:29:13.000000000 +0200 @@ -31,9 +31,11 @@ travis_ci.ENVIRONMENT_VARIABLES, ] +metadata_key = pytest.StashKey[dict]() + def pytest_addhooks(pluginmanager): - from . import hooks + from pytest_metadata import hooks pluginmanager.add_hookspecs(hooks) @@ -41,19 +43,20 @@ @pytest.fixture(scope="session") def metadata(pytestconfig): """Provide test session metadata""" - return pytestconfig._metadata + return pytestconfig.stash[metadata_key] @pytest.fixture(scope="session") def include_metadata_in_junit_xml(metadata, pytestconfig, record_testsuite_property): """Provide test session metadata""" - metadata_ = pytestconfig._metadata + metadata_ = pytestconfig.stash[metadata_key] for name, value in metadata_.items(): record_testsuite_property(name, value) def pytest_addoption(parser): - parser.addoption( + group = parser.getgroup("pytest-metadata") + group.addoption( "--metadata", action="append", default=[], @@ -62,14 +65,14 @@ nargs=2, help="additional metadata.", ) - parser.addoption( + group.addoption( "--metadata-from-json", action="store", default="{}", dest="metadata_from_json", help="additional metadata from a json string.", ) - parser.addoption( + group.addoption( "--metadata-from-json-file", type=str, dest="metadata_from_json_file", @@ -79,7 +82,7 @@ @pytest.hookimpl(tryfirst=True) def pytest_configure(config): - config._metadata = { + config.stash[metadata_key] = { "Python": platform.python_version(), "Platform": platform.platform(), "Packages": { @@ -87,35 +90,34 @@ "pluggy": pluggy.__version__, }, } - config._metadata.update({k: v for k, v in config.getoption("metadata")}) - config._metadata.update(json.loads(config.getoption("metadata_from_json"))) + config.stash[metadata_key].update({k: v for k, v in config.getoption("metadata")}) + config.stash[metadata_key].update( + json.loads(config.getoption("metadata_from_json")) + ) if config.getoption("metadata_from_json_file"): with open(config.getoption("metadata_from_json_file"), "r") as json_file: - config._metadata.update(json.load(json_file)) + config.stash[metadata_key].update(json.load(json_file)) plugins = dict() for plugin, dist in config.pluginmanager.list_plugin_distinfo(): name, version = dist.project_name, dist.version if name.startswith("pytest-"): name = name[7:] plugins[name] = version - config._metadata["Plugins"] = plugins + config.stash[metadata_key]["Plugins"] = plugins for provider in CONTINUOUS_INTEGRATION: - [ - config._metadata.update({var: os.environ.get(var)}) - for var in provider - if os.environ.get(var) - ] + for var in provider: + if os.environ.get(var): + config.stash[metadata_key].update({var: os.environ.get(var)}) if hasattr(config, "workeroutput"): - config.workeroutput["metadata"] = config._metadata - - config.hook.pytest_metadata(metadata=config._metadata) + config.workeroutput["metadata"] = config.stash[metadata_key] + config.hook.pytest_metadata(metadata=config.stash[metadata_key], config=config) def pytest_report_header(config): if config.getoption("verbose") > 0: - return "metadata: {0}".format(config._metadata) + return "metadata: {0}".format(config.stash[metadata_key]) @pytest.hookimpl(optionalhook=True) @@ -123,4 +125,4 @@ # note that any metadata from remote workers will be replaced with the # environment from the final worker to quit if hasattr(node, "workeroutput"): - node.config._metadata.update(node.workeroutput["metadata"]) + node.config.stash[metadata_key].update(node.workeroutput["metadata"]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest_metadata-2.0.4/tests/test_metadata.py new/pytest_metadata-3.0.0/tests/test_metadata.py --- old/pytest_metadata-2.0.4/tests/test_metadata.py 2022-10-30 22:14:24.004578800 +0100 +++ new/pytest_metadata-3.0.0/tests/test_metadata.py 2023-05-27 20:29:13.000000000 +0200 @@ -131,7 +131,7 @@ testdir.makeconftest( """ import pytest - @pytest.mark.optionalhook + @pytest.hookimpl(optionalhook=True) def pytest_metadata(metadata): metadata['Dave'] = 'Hunt' """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest_metadata-2.0.4/tox.ini new/pytest_metadata-3.0.0/tox.ini --- old/pytest_metadata-2.0.4/tox.ini 1970-01-01 01:00:00.000000000 +0100 +++ new/pytest_metadata-3.0.0/tox.ini 2023-05-27 20:29:13.000000000 +0200 @@ -0,0 +1,31 @@ +[tox] +envlist = py{3.7, 3.8, 3.9, 3.10, py3.9}, linting +isolated_build = True + +[testenv] +setenv = + PYTHONDONTWRITEBYTECODE=1 +commands = pytest -s -ra --color=yes {posargs} + +[testenv:linting] +skip_install = True +basepython = python3 +deps = pre-commit +commands = pre-commit run --all-files --show-diff-on-failure + +[testenv:devel] +description = Tests with unreleased deps +basepython = python3 +pip_pre = True +deps = + pytest @ git+https://github.com/pytest-dev/pytest.git + +[flake8] +max-line-length = 120 +exclude = .eggs,.tox +# rationale here: +# https://github.com/psf/black/blob/master/docs/the_black_code_style.md#slices +extend-ignore = E203 + +[pytest] +testpaths = tests