Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-pytest-describe for
openSUSE:Factory checked in at 2022-05-02 16:26:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pytest-describe (Old)
and /work/SRC/openSUSE:Factory/.python-pytest-describe.new.1538 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pytest-describe"
Mon May 2 16:26:12 2022 rev:2 rq:974410 version:2.0.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-pytest-describe/python-pytest-describe.changes
2020-08-10 15:08:39.064282217 +0200
+++
/work/SRC/openSUSE:Factory/.python-pytest-describe.new.1538/python-pytest-describe.changes
2022-05-02 16:26:41.396912956 +0200
@@ -1,0 +2,8 @@
+Mon May 2 08:00:02 UTC 2022 - Mark??ta Machov?? <[email protected]>
+
+- Update to 2.0.1
+ * This version supports pytest 4.0 to 6.2 on Python 3.6 to 3.10
+ * Support list/tuple argnames for mark.parametrize
+ * Made markers consistent with pytest's defaults
+
+-------------------------------------------------------------------
Old:
----
pytest-describe-1.0.0.tar.gz
New:
----
pytest-describe-2.0.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pytest-describe.spec ++++++
--- /var/tmp/diff_new_pack.dhe4IY/_old 2022-05-02 16:26:41.896913512 +0200
+++ /var/tmp/diff_new_pack.dhe4IY/_new 2022-05-02 16:26:41.904913521 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-pytest-describe
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,8 +17,9 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
+%define skip_python2 1
Name: python-pytest-describe
-Version: 1.0.0
+Version: 2.0.1
Release: 0
Summary: Describe-style plugin for pytest
License: MIT
@@ -28,10 +29,10 @@
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
-Requires: python-pytest >= 2.6.0
+Requires: python-pytest >= 4.0
BuildArch: noarch
# SECTION test requirements
-BuildRequires: %{python_module pytest >= 2.6.0}
+BuildRequires: %{python_module pytest >= 4.0}
# /SECTION
%python_subpackages
++++++ pytest-describe-1.0.0.tar.gz -> pytest-describe-2.0.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-describe-1.0.0/.github/workflows/main.yml
new/pytest-describe-2.0.1/.github/workflows/main.yml
--- old/pytest-describe-1.0.0/.github/workflows/main.yml 1970-01-01
01:00:00.000000000 +0100
+++ new/pytest-describe-2.0.1/.github/workflows/main.yml 2021-11-13
21:10:01.000000000 +0100
@@ -0,0 +1,93 @@
+name: main
+
+on:
+ push:
+ branches:
+ - main
+ tags:
+ - "*"
+
+ pull_request:
+ branches:
+ - main
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ python: [3.6, 3.7, 3.8, 3.9, pypy3]
+
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ - name: Set up Python ${{ matrix.python }}
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python }}
+
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip setuptools
+ python -m pip install tox
+
+ - name: Test with Python 3.6
+ if: matrix.python == '3.6'
+ run: tox -e "py36-pytest_{4,50,51,52,53,54,60,61,62,latest}"
+
+ - name: Test with Python 3.7
+ if: matrix.python == '3.7'
+ run: tox -e "py37-pytest_{4,50,51,52,53,54,60,61,62,latest}"
+
+ - name: Test with Python 3.8
+ if: matrix.python == '3.8'
+ run: tox -e "py38-pytest_{4,50,51,52,53,54,60,61,62,latest}"
+
+ - name: Test with Python 3.9
+ if: matrix.python == '3.9'
+ run: tox -e "py39-pytest_{4,50,51,52,53,54,60,61,62,latest}"
+
+ - name: Test with Python 3.10
+ if: matrix.python == '3.10'
+ run: tox -e "py310-pytest_{62,latest}"
+
+ - name: Test with PyPy
+ if: matrix.python == 'pypy3'
+ run: tox -e "pypy-pytest_{4,50,51,52,53,54,60,61,62,latest}"
+
+ - name: Linting with Flake8
+ if: matrix.python == '3.9'
+ run: tox -e flake8
+
+ deploy:
+ if: |
+ github.event_name == 'push' &&
+ startsWith(github.event.ref, 'refs/tags') &&
+ github.repository == 'pytest-dev/pytest-describe'
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ - uses: actions/setup-python@v2
+ with:
+ python-version: "3.9"
+
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install --upgrade wheel setuptools setuptools_scm
+
+ - name: Build package
+ run: python setup.py sdist bdist_wheel
+
+ - name: Publish package
+ uses: pypa/[email protected]
+ with:
+ user: __token__
+ password: ${{ secrets.pypi_token }}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-describe-1.0.0/.gitignore
new/pytest-describe-2.0.1/.gitignore
--- old/pytest-describe-1.0.0/.gitignore 1970-01-01 01:00:00.000000000
+0100
+++ new/pytest-describe-2.0.1/.gitignore 2021-11-13 21:10:01.000000000
+0100
@@ -0,0 +1,56 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+share/python-wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.nox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+.hypothesis/
+.pytest_cache/
+
+# pyenv
+.python-version
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# IDEs
+.idea
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-describe-1.0.0/PKG-INFO
new/pytest-describe-2.0.1/PKG-INFO
--- old/pytest-describe-1.0.0/PKG-INFO 2020-04-22 00:02:15.572751000 +0200
+++ new/pytest-describe-2.0.1/PKG-INFO 2021-11-13 21:10:06.757585000 +0100
@@ -1,163 +1,177 @@
-Metadata-Version: 2.1
-Name: pytest-describe
-Version: 1.0.0
-Summary: Describe-style plugin for pytest
-Home-page: https://github.com/pytest-dev/pytest-describe
-Author: Robin Pedersen
-Author-email: [email protected]
-License: MIT license
-Description: .. image::
https://travis-ci.org/pytest-dev/pytest-describe.svg?branch=master
- :target: https://travis-ci.org/pytest-dev/pytest-describe
-
- Describe-style plugin for pytest
- ================================
-
- pytest-describe is a plugin for pytest that allows tests to be written
in
- arbitrary nested describe-blocks, similar to RSpec (Ruby) and Jasmine
- (JavaScript).
-
- The main inspiration for this was a `video
- <https://www.youtube.com/watch?v=JJle8L8FRy0>`_ by Gary Bernhardt.
-
- Installation
- ------------
-
- You guessed it::
-
- pip install pytest-describe
-
-
- Example
- -------
-
- .. code-block:: python
-
- def describe_list():
-
- @pytest.fixture
- def list():
- return []
-
- def describe_append():
-
- def adds_to_end_of_list(list):
- list.append('foo')
- list.append('bar')
- assert list == ['foo', 'bar']
-
- def describe_remove():
-
- @pytest.fixture
- def list():
- return ['foo', 'bar']
-
- def removes_item_from_list(list):
- list.remove('foo')
- assert list == ['bar']
-
-
- Why bother?
- ===========
-
- I've found that quite often my tests have one "dimension" more than my
production
- code. The production code is organized into packages, modules, classes
- (sometimes), and functions. I like to organize my tests in the same
way, but
- tests also have different *cases* for each function. This tends to end
up with
- a set of tests for each module (or class), where each test has to name
both a
- function and a *case*. For instance:
-
- .. code-block:: python
-
- def test_my_function_with_default_arguments():
- def test_my_function_with_some_other_arguments():
- def test_my_function_throws_exception():
- def test_my_function_handles_exception():
- def test_some_other_function_returns_true():
- def test_some_other_function_returns_false():
-
- It's much nicer to do this:
-
- .. code-block:: python
-
- def describe_my_function():
- def with_default_arguments():
- def with_some_other_arguments():
- def it_throws_exception():
- def it_handles_exception():
-
- def describe_some_other_function():
- def it_returns_true():
- def it_returns_false():
-
- It has the additional advantage that you can have marks and fixtures
that apply
- locally to each group of test function.
-
- With pytest, it's possible to organize tests in a similar way with
classes.
- However, I think classes are awkward. I don't think the convention of
using
- camel-case names for classes fit very well when testing functions in
different
- cases. In addition, every test function must take a "self" argument
that is
- never used.
-
- The pytest-describe plugin allows organizing your tests in the nicer
way shown
- above using describe-blocks. The functions inside the describe-blocks
need not
- follow any special naming convention, they are always executed as
tests unless
- they start with an underscore. The functions used for describe-blocks
must
- start with ``describe_``, but you can configure this prefix with the
setting
- ``describe_prefixes`` in the pytest configuration file.
-
-
- Shared Behaviors
- ================
-
- If you've used rspec's shared examples or test class inheritance, then
you may
- be familiar with the benefit of having the same tests apply to
- multiple "subjects" or "suts" (system under test).
-
- .. code-block:: python
-
- from pytest import fixture
- from pytest_describe import behaves_like
-
- def a_duck():
- def it_quacks(sound):
- assert sound == "quack"
-
- @behaves_like(a_duck)
- def describe_something_that_quacks():
- @fixture
- def sound():
- return "quack"
-
- # the it_quacks test in this describe will pass
-
- @behaves_like(a_duck)
- def describe_something_that_barks():
- @fixture
- def sound():
- return "bark"
-
- # the it_quacks test in this describe will fail (as expected)
-
- Fixtures defined in the block that includes the shared behavior take
precedence
- over fixtures defined in the shared behavior. This rule only applies to
- fixtures, not to other functions (nested describe blocks and tests).
Instead,
- they are all collected as separate tests.
-
-Platform: UNKNOWN
-Classifier: Development Status :: 3 - Alpha
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: MIT License
-Classifier: Operating System :: POSIX
-Classifier: Operating System :: Microsoft :: Windows
-Classifier: Operating System :: MacOS :: MacOS X
-Classifier: Topic :: Software Development :: Testing
-Classifier: Topic :: Software Development :: Libraries
-Classifier: Topic :: Utilities
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.5
-Classifier: Programming Language :: Python :: 3.6
-Classifier: Programming Language :: Python :: 3.7
-Classifier: Programming Language :: Python :: 3.8
-Description-Content-Type: text/x-rst
+Metadata-Version: 2.1
+Name: pytest-describe
+Version: 2.0.1
+Summary: Describe-style plugin for pytest
+Home-page: https://github.com/pytest-dev/pytest-describe
+Author: Robin Pedersen
+Author-email: [email protected]
+Maintainer: Christoph Zwerschke
+Maintainer-email: [email protected]
+License: MIT
+Platform: unix
+Platform: linux
+Platform: osx
+Platform: cygwin
+Platform: win32
+Classifier: Development Status :: 4 - Beta
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: MIT License
+Classifier: Operating System :: POSIX
+Classifier: Operating System :: Microsoft :: Windows
+Classifier: Operating System :: MacOS :: MacOS X
+Classifier: Topic :: Software Development :: Testing
+Classifier: Topic :: Software Development :: Libraries
+Classifier: Topic :: Utilities
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3 :: Only
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
+Classifier: Programming Language :: Python :: 3.10
+Description-Content-Type: text/x-rst
+License-File: LICENSE
+
+.. image:: https://badge.fury.io/py/pytest-describe.svg
+ :target: https://pypi.org/project/pytest-describe/
+ :alt: PyPI version
+
+.. image::
https://github.com/pytest-dev/pytest-describe/actions/workflows/main.yml/badge.svg
+ :target: https://github.com/pytest-dev/pytest-describe/actions
+ :alt: Workflow status
+
+Describe-style plugin for pytest
+================================
+
+pytest-describe is a plugin for pytest that allows tests to be written in
+arbitrary nested describe-blocks, similar to RSpec (Ruby) and Jasmine
+(JavaScript).
+
+The main inspiration for this was a `video
+<https://www.youtube.com/watch?v=JJle8L8FRy0>`_ by Gary Bernhardt.
+
+Installation
+------------
+
+You guessed it::
+
+ pip install pytest-describe
+
+
+Example
+-------
+
+.. code-block:: python
+
+ def describe_list():
+
+ @pytest.fixture
+ def list():
+ return []
+
+ def describe_append():
+
+ def adds_to_end_of_list(list):
+ list.append('foo')
+ list.append('bar')
+ assert list == ['foo', 'bar']
+
+ def describe_remove():
+
+ @pytest.fixture
+ def list():
+ return ['foo', 'bar']
+
+ def removes_item_from_list(list):
+ list.remove('foo')
+ assert list == ['bar']
+
+
+Why bother?
+===========
+
+I've found that quite often my tests have one "dimension" more than my
production
+code. The production code is organized into packages, modules, classes
+(sometimes), and functions. I like to organize my tests in the same way, but
+tests also have different *cases* for each function. This tends to end up with
+a set of tests for each module (or class), where each test has to name both a
+function and a *case*. For instance:
+
+.. code-block:: python
+
+ def test_my_function_with_default_arguments():
+ def test_my_function_with_some_other_arguments():
+ def test_my_function_throws_exception():
+ def test_my_function_handles_exception():
+ def test_some_other_function_returns_true():
+ def test_some_other_function_returns_false():
+
+It's much nicer to do this:
+
+.. code-block:: python
+
+ def describe_my_function():
+ def with_default_arguments():
+ def with_some_other_arguments():
+ def it_throws_exception():
+ def it_handles_exception():
+
+ def describe_some_other_function():
+ def it_returns_true():
+ def it_returns_false():
+
+It has the additional advantage that you can have marks and fixtures that apply
+locally to each group of test function.
+
+With pytest, it's possible to organize tests in a similar way with classes.
+However, I think classes are awkward. I don't think the convention of using
+camel-case names for classes fit very well when testing functions in different
+cases. In addition, every test function must take a "self" argument that is
+never used.
+
+The pytest-describe plugin allows organizing your tests in the nicer way shown
+above using describe-blocks. The functions inside the describe-blocks need not
+follow any special naming convention, they are always executed as tests unless
+they start with an underscore. The functions used for describe-blocks must
+start with ``describe_``, but you can configure this prefix with the setting
+``describe_prefixes`` in the pytest configuration file.
+
+
+Shared Behaviors
+================
+
+If you've used rspec's shared examples or test class inheritance, then you may
+be familiar with the benefit of having the same tests apply to
+multiple "subjects" or "suts" (system under test).
+
+.. code-block:: python
+
+ from pytest import fixture
+ from pytest_describe import behaves_like
+
+ def a_duck():
+ def it_quacks(sound):
+ assert sound == "quack"
+
+ @behaves_like(a_duck)
+ def describe_something_that_quacks():
+ @fixture
+ def sound():
+ return "quack"
+
+ # the it_quacks test in this describe will pass
+
+ @behaves_like(a_duck)
+ def describe_something_that_barks():
+ @fixture
+ def sound():
+ return "bark"
+
+ # the it_quacks test in this describe will fail (as expected)
+
+Fixtures defined in the block that includes the shared behavior take precedence
+over fixtures defined in the shared behavior. This rule only applies to
+fixtures, not to other functions (nested describe blocks and tests). Instead,
+they are all collected as separate tests.
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-describe-1.0.0/README.rst
new/pytest-describe-2.0.1/README.rst
--- old/pytest-describe-1.0.0/README.rst 2020-04-21 23:37:52.000000000
+0200
+++ new/pytest-describe-2.0.1/README.rst 2021-11-13 21:10:01.000000000
+0100
@@ -1,5 +1,10 @@
-.. image:: https://travis-ci.org/pytest-dev/pytest-describe.svg?branch=master
- :target: https://travis-ci.org/pytest-dev/pytest-describe
+.. image:: https://badge.fury.io/py/pytest-describe.svg
+ :target: https://pypi.org/project/pytest-describe/
+ :alt: PyPI version
+
+.. image::
https://github.com/pytest-dev/pytest-describe/actions/workflows/main.yml/badge.svg
+ :target: https://github.com/pytest-dev/pytest-describe/actions
+ :alt: Workflow status
Describe-style plugin for pytest
================================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-describe-1.0.0/pytest_describe/plugin.py
new/pytest-describe-2.0.1/pytest_describe/plugin.py
--- old/pytest-describe-1.0.0/pytest_describe/plugin.py 2020-04-21
23:37:52.000000000 +0200
+++ new/pytest-describe-2.0.1/pytest_describe/plugin.py 2021-11-13
21:10:01.000000000 +0100
@@ -1,7 +1,10 @@
-import functools
import sys
import types
-from _pytest.python import PyCollector
+import pytest
+
+
+PYTEST_GTE_7_0 = getattr(pytest, 'version_tuple', (0, 0)) >= (7, 0)
+PYTEST_GTE_5_4 = PYTEST_GTE_7_0 or hasattr(pytest.Collector, 'from_parent')
def trace_function(funcobj, *args, **kwargs):
@@ -12,7 +15,7 @@
# Activate local trace for first call only
if frame.f_back.f_locals.get('_tracefunc') == _tracefunc:
if event == 'return':
- funclocals.update(frame.f_locals.copy())
+ funclocals.update(frame.f_locals)
sys.setprofile(_tracefunc)
try:
@@ -50,104 +53,52 @@
# want fixtures to be overridden in the block that's importing the
# behavior.
if not hasattr(obj, '_pytestfixturefunction'):
- name = obj._mangled_name = "{}::{}".format(funcobj.__name__,
name)
+ name = obj._mangled_name = f"{funcobj.__name__}::{name}"
funcobj._shared_functions[name] = obj
return funcobj._shared_functions
-def copy_markinfo(module, funcobj):
- copy_deprecated_markinfo(module, funcobj)
- for obj in module.__dict__.values():
- if isinstance(obj, types.FunctionType):
- merge_pytestmark(obj, funcobj)
-
-
-def copy_deprecated_markinfo(module, funcobj):
- # For pytest < 3.6 we also need to copy MarkInfo properties
- try:
- from _pytest.mark import MarkInfo
-
- marks = {}
- for name, val in funcobj.__dict__.items():
- if isinstance(val, MarkInfo):
- marks[name] = val
-
- for obj in module.__dict__.values():
- if isinstance(obj, types.FunctionType):
- for name, mark in marks.items():
- setattr(obj, name, mark)
- except ImportError:
- pass
-
-
-def merge_pytestmark(obj, parentobj):
- marks = dict(pytestmark_dict(parentobj))
- marks.update(pytestmark_dict(obj))
- if marks:
- obj.pytestmark = list(marks.values())
-
-
-def pytestmark_name(mark):
- name = mark.name
- if name == 'parametrize':
- name += '-' + mark.args[0]
- return name
-
-
-def pytestmark_dict(obj):
- try:
- marks = obj.pytestmark
- if not isinstance(marks, list):
- marks = [marks]
- return {pytestmark_name(mark): mark for mark in marks}
- except AttributeError:
- return {}
-
-
-class DescribeBlock(PyCollector):
+class DescribeBlock(pytest.Module):
"""Module-like object representing the scope of a describe block"""
@classmethod
def from_parent(cls, parent, obj):
- name = obj.__name__
- try:
- from_parent_super = super(DescribeBlock, cls).from_parent
- except AttributeError: # PyTest < 5.4
- self = cls(name, parent)
+ """Construct a new node for the describe block"""
+ name = getattr(obj, '_mangled_name', obj.__name__)
+ nodeid = parent.nodeid + '::' + name
+ if PYTEST_GTE_7_0:
+ self = super().from_parent(
+ parent=parent, path=parent.path, nodeid=nodeid)
+ elif PYTEST_GTE_5_4:
+ self = super().from_parent(
+ parent=parent, fspath=parent.fspath, nodeid=nodeid)
else:
- self = from_parent_super(parent, name=name)
- self._name = getattr(obj, '_mangled_name', name)
+ self = cls(parent=parent, fspath=parent.fspath, nodeid=nodeid)
+ self.name = name
self.funcobj = obj
return self
def collect(self):
+ """Get list of children"""
self.session._fixturemanager.parsefactories(self)
- return super(DescribeBlock, self).collect()
+ return super().collect()
def _getobj(self):
- # In older versions of pytest, the python module collector used this
- # memoizedcall function, but it was removed in newer versions. I'm not
- # sure if this was ever necessary, but just trying to stay consistent
- # with whatever pytest is doing, using a little bit of trial and error.
- try:
- return self._memoizedcall('_obj', self._importtestmodule)
- except AttributeError:
- return self._importtestmodule()
-
- def _makeid(self):
- """Magic that makes fixtures local to each scope"""
- return self.parent.nodeid + '::' + self._name
+ """Get the underlying Python object"""
+ return self._importtestmodule()
def _importtestmodule(self):
"""Import a describe block as if it was a module"""
module = make_module_from_function(self.funcobj)
- copy_markinfo(module, self.funcobj)
- merge_pytestmark(module, self.parent.obj)
+ self.own_markers = getattr(self.funcobj, 'pytestmark', [])
return module
def funcnamefilter(self, name):
- """Treat all nested functions as tests, without requiring the 'test_'
prefix"""
+ """Treat all nested functions as tests
+
+ We do not require the 'test_' prefix for the specs.
+ """
return not name.startswith('_')
def classnamefilter(self, name):
@@ -155,8 +106,7 @@
return False
def __repr__(self):
- return "<{} {}>".format(self.__class__.__name__,
- repr(self._name))
+ return f"<{self.__class__.__name__} {self.name!r}>"
def pytest_pycollect_makeitem(collector, name, obj):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-describe-1.0.0/pytest_describe.egg-info/PKG-INFO
new/pytest-describe-2.0.1/pytest_describe.egg-info/PKG-INFO
--- old/pytest-describe-1.0.0/pytest_describe.egg-info/PKG-INFO 2020-04-22
00:02:15.000000000 +0200
+++ new/pytest-describe-2.0.1/pytest_describe.egg-info/PKG-INFO 2021-11-13
21:10:06.000000000 +0100
@@ -1,163 +1,177 @@
-Metadata-Version: 2.1
-Name: pytest-describe
-Version: 1.0.0
-Summary: Describe-style plugin for pytest
-Home-page: https://github.com/pytest-dev/pytest-describe
-Author: Robin Pedersen
-Author-email: [email protected]
-License: MIT license
-Description: .. image::
https://travis-ci.org/pytest-dev/pytest-describe.svg?branch=master
- :target: https://travis-ci.org/pytest-dev/pytest-describe
-
- Describe-style plugin for pytest
- ================================
-
- pytest-describe is a plugin for pytest that allows tests to be written
in
- arbitrary nested describe-blocks, similar to RSpec (Ruby) and Jasmine
- (JavaScript).
-
- The main inspiration for this was a `video
- <https://www.youtube.com/watch?v=JJle8L8FRy0>`_ by Gary Bernhardt.
-
- Installation
- ------------
-
- You guessed it::
-
- pip install pytest-describe
-
-
- Example
- -------
-
- .. code-block:: python
-
- def describe_list():
-
- @pytest.fixture
- def list():
- return []
-
- def describe_append():
-
- def adds_to_end_of_list(list):
- list.append('foo')
- list.append('bar')
- assert list == ['foo', 'bar']
-
- def describe_remove():
-
- @pytest.fixture
- def list():
- return ['foo', 'bar']
-
- def removes_item_from_list(list):
- list.remove('foo')
- assert list == ['bar']
-
-
- Why bother?
- ===========
-
- I've found that quite often my tests have one "dimension" more than my
production
- code. The production code is organized into packages, modules, classes
- (sometimes), and functions. I like to organize my tests in the same
way, but
- tests also have different *cases* for each function. This tends to end
up with
- a set of tests for each module (or class), where each test has to name
both a
- function and a *case*. For instance:
-
- .. code-block:: python
-
- def test_my_function_with_default_arguments():
- def test_my_function_with_some_other_arguments():
- def test_my_function_throws_exception():
- def test_my_function_handles_exception():
- def test_some_other_function_returns_true():
- def test_some_other_function_returns_false():
-
- It's much nicer to do this:
-
- .. code-block:: python
-
- def describe_my_function():
- def with_default_arguments():
- def with_some_other_arguments():
- def it_throws_exception():
- def it_handles_exception():
-
- def describe_some_other_function():
- def it_returns_true():
- def it_returns_false():
-
- It has the additional advantage that you can have marks and fixtures
that apply
- locally to each group of test function.
-
- With pytest, it's possible to organize tests in a similar way with
classes.
- However, I think classes are awkward. I don't think the convention of
using
- camel-case names for classes fit very well when testing functions in
different
- cases. In addition, every test function must take a "self" argument
that is
- never used.
-
- The pytest-describe plugin allows organizing your tests in the nicer
way shown
- above using describe-blocks. The functions inside the describe-blocks
need not
- follow any special naming convention, they are always executed as
tests unless
- they start with an underscore. The functions used for describe-blocks
must
- start with ``describe_``, but you can configure this prefix with the
setting
- ``describe_prefixes`` in the pytest configuration file.
-
-
- Shared Behaviors
- ================
-
- If you've used rspec's shared examples or test class inheritance, then
you may
- be familiar with the benefit of having the same tests apply to
- multiple "subjects" or "suts" (system under test).
-
- .. code-block:: python
-
- from pytest import fixture
- from pytest_describe import behaves_like
-
- def a_duck():
- def it_quacks(sound):
- assert sound == "quack"
-
- @behaves_like(a_duck)
- def describe_something_that_quacks():
- @fixture
- def sound():
- return "quack"
-
- # the it_quacks test in this describe will pass
-
- @behaves_like(a_duck)
- def describe_something_that_barks():
- @fixture
- def sound():
- return "bark"
-
- # the it_quacks test in this describe will fail (as expected)
-
- Fixtures defined in the block that includes the shared behavior take
precedence
- over fixtures defined in the shared behavior. This rule only applies to
- fixtures, not to other functions (nested describe blocks and tests).
Instead,
- they are all collected as separate tests.
-
-Platform: UNKNOWN
-Classifier: Development Status :: 3 - Alpha
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: MIT License
-Classifier: Operating System :: POSIX
-Classifier: Operating System :: Microsoft :: Windows
-Classifier: Operating System :: MacOS :: MacOS X
-Classifier: Topic :: Software Development :: Testing
-Classifier: Topic :: Software Development :: Libraries
-Classifier: Topic :: Utilities
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.5
-Classifier: Programming Language :: Python :: 3.6
-Classifier: Programming Language :: Python :: 3.7
-Classifier: Programming Language :: Python :: 3.8
-Description-Content-Type: text/x-rst
+Metadata-Version: 2.1
+Name: pytest-describe
+Version: 2.0.1
+Summary: Describe-style plugin for pytest
+Home-page: https://github.com/pytest-dev/pytest-describe
+Author: Robin Pedersen
+Author-email: [email protected]
+Maintainer: Christoph Zwerschke
+Maintainer-email: [email protected]
+License: MIT
+Platform: unix
+Platform: linux
+Platform: osx
+Platform: cygwin
+Platform: win32
+Classifier: Development Status :: 4 - Beta
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: MIT License
+Classifier: Operating System :: POSIX
+Classifier: Operating System :: Microsoft :: Windows
+Classifier: Operating System :: MacOS :: MacOS X
+Classifier: Topic :: Software Development :: Testing
+Classifier: Topic :: Software Development :: Libraries
+Classifier: Topic :: Utilities
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3 :: Only
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
+Classifier: Programming Language :: Python :: 3.10
+Description-Content-Type: text/x-rst
+License-File: LICENSE
+
+.. image:: https://badge.fury.io/py/pytest-describe.svg
+ :target: https://pypi.org/project/pytest-describe/
+ :alt: PyPI version
+
+.. image::
https://github.com/pytest-dev/pytest-describe/actions/workflows/main.yml/badge.svg
+ :target: https://github.com/pytest-dev/pytest-describe/actions
+ :alt: Workflow status
+
+Describe-style plugin for pytest
+================================
+
+pytest-describe is a plugin for pytest that allows tests to be written in
+arbitrary nested describe-blocks, similar to RSpec (Ruby) and Jasmine
+(JavaScript).
+
+The main inspiration for this was a `video
+<https://www.youtube.com/watch?v=JJle8L8FRy0>`_ by Gary Bernhardt.
+
+Installation
+------------
+
+You guessed it::
+
+ pip install pytest-describe
+
+
+Example
+-------
+
+.. code-block:: python
+
+ def describe_list():
+
+ @pytest.fixture
+ def list():
+ return []
+
+ def describe_append():
+
+ def adds_to_end_of_list(list):
+ list.append('foo')
+ list.append('bar')
+ assert list == ['foo', 'bar']
+
+ def describe_remove():
+
+ @pytest.fixture
+ def list():
+ return ['foo', 'bar']
+
+ def removes_item_from_list(list):
+ list.remove('foo')
+ assert list == ['bar']
+
+
+Why bother?
+===========
+
+I've found that quite often my tests have one "dimension" more than my
production
+code. The production code is organized into packages, modules, classes
+(sometimes), and functions. I like to organize my tests in the same way, but
+tests also have different *cases* for each function. This tends to end up with
+a set of tests for each module (or class), where each test has to name both a
+function and a *case*. For instance:
+
+.. code-block:: python
+
+ def test_my_function_with_default_arguments():
+ def test_my_function_with_some_other_arguments():
+ def test_my_function_throws_exception():
+ def test_my_function_handles_exception():
+ def test_some_other_function_returns_true():
+ def test_some_other_function_returns_false():
+
+It's much nicer to do this:
+
+.. code-block:: python
+
+ def describe_my_function():
+ def with_default_arguments():
+ def with_some_other_arguments():
+ def it_throws_exception():
+ def it_handles_exception():
+
+ def describe_some_other_function():
+ def it_returns_true():
+ def it_returns_false():
+
+It has the additional advantage that you can have marks and fixtures that apply
+locally to each group of test function.
+
+With pytest, it's possible to organize tests in a similar way with classes.
+However, I think classes are awkward. I don't think the convention of using
+camel-case names for classes fit very well when testing functions in different
+cases. In addition, every test function must take a "self" argument that is
+never used.
+
+The pytest-describe plugin allows organizing your tests in the nicer way shown
+above using describe-blocks. The functions inside the describe-blocks need not
+follow any special naming convention, they are always executed as tests unless
+they start with an underscore. The functions used for describe-blocks must
+start with ``describe_``, but you can configure this prefix with the setting
+``describe_prefixes`` in the pytest configuration file.
+
+
+Shared Behaviors
+================
+
+If you've used rspec's shared examples or test class inheritance, then you may
+be familiar with the benefit of having the same tests apply to
+multiple "subjects" or "suts" (system under test).
+
+.. code-block:: python
+
+ from pytest import fixture
+ from pytest_describe import behaves_like
+
+ def a_duck():
+ def it_quacks(sound):
+ assert sound == "quack"
+
+ @behaves_like(a_duck)
+ def describe_something_that_quacks():
+ @fixture
+ def sound():
+ return "quack"
+
+ # the it_quacks test in this describe will pass
+
+ @behaves_like(a_duck)
+ def describe_something_that_barks():
+ @fixture
+ def sound():
+ return "bark"
+
+ # the it_quacks test in this describe will fail (as expected)
+
+Fixtures defined in the block that includes the shared behavior take precedence
+over fixtures defined in the shared behavior. This rule only applies to
+fixtures, not to other functions (nested describe blocks and tests). Instead,
+they are all collected as separate tests.
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-describe-1.0.0/pytest_describe.egg-info/SOURCES.txt
new/pytest-describe-2.0.1/pytest_describe.egg-info/SOURCES.txt
--- old/pytest-describe-1.0.0/pytest_describe.egg-info/SOURCES.txt
2020-04-22 00:02:15.000000000 +0200
+++ new/pytest-describe-2.0.1/pytest_describe.egg-info/SOURCES.txt
2021-11-13 21:10:06.000000000 +0100
@@ -1,8 +1,10 @@
+.gitignore
LICENSE
MANIFEST.in
README.rst
setup.py
tox.ini
+.github/workflows/main.yml
pytest_describe/__init__.py
pytest_describe/plugin.py
pytest_describe/shared.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-describe-1.0.0/pytest_describe.egg-info/requires.txt
new/pytest-describe-2.0.1/pytest_describe.egg-info/requires.txt
--- old/pytest-describe-1.0.0/pytest_describe.egg-info/requires.txt
2020-04-22 00:02:15.000000000 +0200
+++ new/pytest-describe-2.0.1/pytest_describe.egg-info/requires.txt
2021-11-13 21:10:06.000000000 +0100
@@ -1 +1 @@
-pytest>=2.6.0
+pytest>=4.0.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-describe-1.0.0/setup.cfg
new/pytest-describe-2.0.1/setup.cfg
--- old/pytest-describe-1.0.0/setup.cfg 2020-04-22 00:02:15.573728800 +0200
+++ new/pytest-describe-2.0.1/setup.cfg 2021-11-13 21:10:06.757585000 +0100
@@ -1,4 +1,4 @@
-[egg_info]
-tag_build =
-tag_date = 0
-
+[egg_info]
+tag_build =
+tag_date = 0
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-describe-1.0.0/setup.py
new/pytest-describe-2.0.1/setup.py
--- old/pytest-describe-1.0.0/setup.py 2020-04-21 23:39:18.000000000 +0200
+++ new/pytest-describe-2.0.1/setup.py 2021-11-13 21:10:01.000000000 +0100
@@ -7,25 +7,29 @@
setup(
name='pytest-describe',
- version='1.0.0',
+ version='2.0.1',
description='Describe-style plugin for pytest',
long_description=readme,
long_description_content_type='text/x-rst',
url='https://github.com/pytest-dev/pytest-describe',
author='Robin Pedersen',
author_email='[email protected]',
- license='MIT license',
+ maintainer='Christoph Zwerschke',
+ maintainer_email='[email protected]',
+ license='MIT',
+ license_file='LICENSE',
+ platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
install_requires=[
- 'pytest>=2.6.0',
+ 'pytest>=4.0.0',
],
entry_points={
'pytest11': [
- 'pytest-describe = pytest_describe.plugin'
+ 'pytest-describe = pytest_describe.plugin',
],
},
packages=['pytest_describe'],
classifiers=[
- 'Development Status :: 3 - Alpha',
+ 'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX',
@@ -34,12 +38,12 @@
'Topic :: Software Development :: Testing',
'Topic :: Software Development :: Libraries',
'Topic :: Utilities',
- 'Programming Language :: Python :: 2',
- 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
+ 'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.10',
],
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-describe-1.0.0/test/test_collect.py
new/pytest-describe-2.0.1/test/test_collect.py
--- old/pytest-describe-1.0.0/test/test_collect.py 2020-04-21
23:37:52.000000000 +0200
+++ new/pytest-describe-2.0.1/test/test_collect.py 2021-11-13
21:10:01.000000000 +0100
@@ -5,6 +5,7 @@
pytest_plugins = 'pytester'
+
def test_collect(testdir):
a_dir = testdir.mkpydir('a_dir')
a_dir.join('test_a.py').write(py.code.Source("""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-describe-1.0.0/test/test_marks.py
new/pytest-describe-2.0.1/test/test_marks.py
--- old/pytest-describe-1.0.0/test/test_marks.py 2020-04-21
23:37:52.000000000 +0200
+++ new/pytest-describe-2.0.1/test/test_marks.py 2021-11-13
21:10:01.000000000 +0100
@@ -1,5 +1,4 @@
import py
-import pytest
from util import assert_outcomes
pytest_plugins = 'pytester'
@@ -32,6 +31,32 @@
assert_outcomes(result, passed=3, xfailed=1, xpassed=1, skipped=1)
+def test_multiple_variables_parametrize(testdir):
+ a_dir = testdir.mkpydir('a_dir')
+ a_dir.join('test_a.py').write(py.code.Source("""
+ import pytest
+
+ def describe_marks():
+ @pytest.mark.parametrize('foo,bar', [(1, 2), (3, 4)])
+ def isint_str_names(foo, bar):
+ assert foo == int(foo)
+ assert bar == int(bar)
+
+ @pytest.mark.parametrize(['foo', 'bar'], [(1, 2), (3, 4)])
+ def isint_list_names(foo, bar):
+ assert foo == int(foo)
+ assert bar == int(bar)
+
+ @pytest.mark.parametrize(('foo', 'bar'), [(1, 2), (3, 4)])
+ def isint_tuple_names(foo, bar):
+ assert foo == int(foo)
+ assert bar == int(bar)
+ """))
+
+ result = testdir.runpytest()
+ assert_outcomes(result, passed=6)
+
+
def test_cartesian_parametrize(testdir):
a_dir = testdir.mkpydir('a_dir')
a_dir.join('test_a.py').write(py.code.Source("""
@@ -50,7 +75,6 @@
assert_outcomes(result, passed=9)
[email protected]("pytest.__version__.startswith('2.')")
def test_parametrize_applies_to_describe(testdir):
a_dir = testdir.mkpydir('a_dir')
a_dir.join('test_a.py').write(py.code.Source("""
@@ -125,7 +149,39 @@
assert_outcomes(result, passed=6)
[email protected]("pytest.__version__.startswith('2.')")
+def test_parametrize_with_shared_but_different_values(testdir):
+ a_dir = testdir.mkpydir('a_dir')
+ a_dir.join('test_a.py').write(py.code.Source("""
+ import pytest
+ from pytest import fixture
+ from pytest_describe import behaves_like
+
+ def a_duck():
+ def it_quacks(sound):
+ assert sound[1] == int(sound[1])
+ assert sound[0] == 'bark' or sound[1] <= 3
+ assert sound[0] == 'quack' or sound[1] >= 4
+
+
+ @pytest.mark.parametrize('foo', (1, 2, 3))
+ @behaves_like(a_duck)
+ def describe_something_that_quacks():
+ @fixture
+ def sound(foo):
+ return ('quack', foo)
+
+ @pytest.mark.parametrize('foo', (4, 5, 6))
+ @behaves_like(a_duck)
+ def describe_something_that_barks():
+ @fixture
+ def sound(foo):
+ return ('bark', foo)
+ """))
+
+ result = testdir.runpytest()
+ assert_outcomes(result, passed=6)
+
+
def test_coincident_parametrize_at_top(testdir):
a_dir = testdir.mkpydir('a_dir')
a_dir.join('test_a.py').write(py.code.Source("""
@@ -215,3 +271,30 @@
result = testdir.runpytest('-m', 'foo')
assert_outcomes(result, passed=2)
+
+
+def test_mark_stacking(testdir):
+ a_dir = testdir.mkpydir('a_dir')
+ a_dir.join('test_a.py').write(py.code.Source("""
+ import pytest
+ @pytest.fixture()
+ def get_marks(request):
+ return [(mark.args[0], node.name) for node, mark
+ in request.node.iter_markers_with_node(name='my_mark')]
+
+ @pytest.mark.my_mark('foo')
+ def describe_marks():
+ def it_is_inherited_from_describe_block(get_marks):
+ assert get_marks == [('foo', 'describe_marks')]
+
+ @pytest.mark.my_mark('bar')
+ @pytest.mark.my_mark('baz')
+ def all_marks_are_chained(get_marks):
+ assert get_marks == [
+ ('baz', 'all_marks_are_chained'),
+ ('bar', 'all_marks_are_chained'),
+ ('foo', 'describe_marks')]
+ """))
+
+ result = testdir.runpytest()
+ assert_outcomes(result, passed=2)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-describe-1.0.0/test/test_output.py
new/pytest-describe-2.0.1/test/test_output.py
--- old/pytest-describe-1.0.0/test/test_output.py 2020-04-21
23:37:52.000000000 +0200
+++ new/pytest-describe-2.0.1/test/test_output.py 2021-11-13
21:10:01.000000000 +0100
@@ -17,8 +17,10 @@
result = testdir.runpytest('-v')
expected = [
- 'a_dir/test_a.py::describe_something::describe_nested_bad::fails
FAILED',
- 'a_dir/test_a.py::describe_something::describe_nested_ok::passes
PASSED',
+ 'a_dir/test_a.py::describe_something::describe_nested_bad::'
+ 'fails FAILED',
+ 'a_dir/test_a.py::describe_something::describe_nested_ok::'
+ 'passes PASSED',
]
for line in expected:
- assert any(l for l in result.outlines if l.startswith(line))
+ assert any(out for out in result.outlines if out.startswith(line))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-describe-1.0.0/test/util.py
new/pytest-describe-2.0.1/test/util.py
--- old/pytest-describe-1.0.0/test/util.py 2020-04-21 23:37:52.000000000
+0200
+++ new/pytest-describe-2.0.1/test/util.py 2021-11-13 21:10:01.000000000
+0100
@@ -1,7 +1,7 @@
def assert_outcomes(result, **expected):
outcomes = result.parseoutcomes()
- for key in 'seconds', 'pytest-warnings', 'warnings', 'warning':
+ for key in 'seconds', 'warning', 'warnings':
if key in outcomes:
del outcomes[key]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-describe-1.0.0/tox.ini
new/pytest-describe-2.0.1/tox.ini
--- old/pytest-describe-1.0.0/tox.ini 2020-04-21 23:37:52.000000000 +0200
+++ new/pytest-describe-2.0.1/tox.ini 2021-11-13 21:10:01.000000000 +0100
@@ -1,21 +1,44 @@
[tox]
-envlist =
{py27,py35,py36}-pytest_{2,3,4},{py35,py36,py37,py38}-pytest_{50,51,52,53,54,latest}
+envlist =
py{36,37,38,39,py}-pytest_{4,50,51,52,53,54,60,61,62,latest,main},py{310}-pytest_{62,latest,main},flake8
[testenv]
basepython =
- py27: python2.7
- py35: python3.5
py36: python3.6
py37: python3.7
py38: python3.8
+ py39: python3.9
+ py310: python3.10
+ pypy: pypy3
deps =
- pytest_2: pytest>=2.9,<3.0
- pytest_3: pytest>=3.10,<4.0
pytest_4: pytest>=4.6,<5.0
pytest_50: pytest>=5.0,<5.2
pytest_51: pytest>=5.1,<5.2
pytest_52: pytest>=5.2,<5.3
pytest_53: pytest>=5.3,<5.4
pytest_54: pytest>=5.4,<5.5
+ pytest_60: pytest>=6.0,<6.1
+ pytest_61: pytest>=6.1,<6.2
+ pytest_62: pytest>=6.2,<6.3
pytest_latest: pytest
-commands = py.test -rw {posargs}
+ pytest_main: git+https://github.com/pytest-dev/pytest.git@main
+commands = pytest -rw {posargs}
+
+[testenv:flake8]
+basepython = python3.9
+deps = flake8>=4,<5
+commands =
+ flake8 pytest_describe test setup.py
+
+[testenv:coverage]
+basepython = python3.9
+deps =
+ coverage
+ pytest
+commands =
+ coverage run --source=pytest_describe -m pytest
+ coverage report -m
+
+[pytest]
+minversion = 4.6
+filterwarnings =
+ ignore:The TerminalReporter\.writer attribute is deprecated, use
TerminalReporter\._tw instead at your own risk\.:DeprecationWarning