Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-pytest-twisted for
openSUSE:Factory checked in at 2023-05-24 20:23:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pytest-twisted (Old)
and /work/SRC/openSUSE:Factory/.python-pytest-twisted.new.1533 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pytest-twisted"
Wed May 24 20:23:20 2023 rev:6 rq:1088896 version:1.14.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-pytest-twisted/python-pytest-twisted.changes
2022-04-23 19:45:32.830953429 +0200
+++
/work/SRC/openSUSE:Factory/.python-pytest-twisted.new.1533/python-pytest-twisted.changes
2023-05-24 20:23:35.392618664 +0200
@@ -1,0 +2,11 @@
+Wed May 17 16:45:17 UTC 2023 - Dirk Müller <[email protected]>
+
+- update to 1.8:
+ * Drop support for EOL Python 2.6
+ * Fix assertion in tests, add new test for blockon usage in
+ fixture
+ * Fixed blockon lock #24
+ * Added ``qt5reactor`` support
+- drop pytest-twisted-pr148-pytest7.patch (upstream)
+
+-------------------------------------------------------------------
Old:
----
pytest-twisted-1.13.4-gh.tar.gz
pytest-twisted-pr148-pytest7.patch
New:
----
pytest-twisted-1.14.0-gh.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pytest-twisted.spec ++++++
--- /var/tmp/diff_new_pack.O0qq7n/_old 2023-05-24 20:23:35.940621932 +0200
+++ /var/tmp/diff_new_pack.O0qq7n/_new 2023-05-24 20:23:35.948621979 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-pytest-twisted
#
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pytest-twisted
-Version: 1.13.4
+Version: 1.14.0
Release: 0
Summary: Pytest Plugin for Twisted
License: BSD-2-Clause
@@ -27,8 +27,6 @@
Source:
https://github.com/pytest-dev/pytest-twisted/archive/v%{version}.tar.gz#/pytest-twisted-%{version}-gh.tar.gz
# PATCH-FIX-OPENSUSE pytest-twisted-ignorepy310DeprecationWarnings.patch --
upstream wants this fixed in twisted itself -- gh#pytest-dev/pytest-twisted/146
Patch0: pytest-twisted-ignorepy310DeprecationWarnings.patch
-# PATCH-FIX-UPSTREAM pytest-twisted-pr148-pytest7.patch --
gh#pytest-dev/pytest-twisted#148
-Patch1:
https://github.com/pytest-dev/pytest-twisted/pull/148.patch#/pytest-twisted-pr148-pytest7.patch
BuildRequires: %{python_module Twisted}
BuildRequires: %{python_module decorator}
BuildRequires: %{python_module greenlet}
++++++ pytest-twisted-1.13.4-gh.tar.gz -> pytest-twisted-1.14.0-gh.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-twisted-1.13.4/.github/workflows/ci.yml
new/pytest-twisted-1.14.0/.github/workflows/ci.yml
--- old/pytest-twisted-1.13.4/.github/workflows/ci.yml 2021-08-31
00:28:40.000000000 +0200
+++ new/pytest-twisted-1.14.0/.github/workflows/ci.yml 2022-10-16
19:08:31.000000000 +0200
@@ -29,15 +29,16 @@
runs-on: ubuntu-latest
python_platform: linux
container:
- 2.7: docker://python:2.7-buster
- 3.5: docker://python:3.5-buster
- 3.6: docker://python:3.6-buster
- 3.7: docker://python:3.7-buster
- 3.8: docker://python:3.8-buster
- 3.9: docker://python:3.9-buster
- pypy2.7: docker://pypy:2.7-buster
- pypy3.6: docker://pypy:3.6-buster
- pypy3.7: docker://pypy:3.7-buster
+ "2.7": docker://python:2.7-buster
+ "3.5": docker://python:3.5-buster
+ "3.6": docker://python:3.6-buster
+ "3.7": docker://python:3.7-buster
+ "3.8": docker://python:3.8-buster
+ "3.9": docker://python:3.9-buster
+ "3.10": docker://python:3.10-buster
+ "pypy2.7": docker://pypy:2.7-buster
+ "pypy3.7": docker://pypy:3.7-buster
+ "pypy3.8": docker://pypy:3.8-buster
- name: ðª
runs-on: windows-latest
python_platform: win32
@@ -81,24 +82,30 @@
docker: 3.9
implementation: cpython
major: 3
+ - name: CPython 3.10
+ tox: py310
+ action: "3.10"
+ docker: "3.10"
+ implementation: cpython
+ major: 3
- name: PyPy 2.7
tox: pypy27
action: pypy-2.7
docker: pypy2.7
implementation: pypy
major: 2
- - name: PyPy 3.6
- tox: pypy36
- action: pypy-3.6
- docker: pypy3.6
- implementation: pypy
- major: 3
- name: PyPy 3.7
tox: pypy37
action: pypy-3.7
docker: pypy3.7
implementation: pypy
major: 3
+ - name: PyPy 3.8
+ tox: pypy38
+ action: pypy-3.8
+ docker: pypy3.8
+ implementation: pypy
+ major: 3
reactor:
- name: default
tox: default
@@ -185,8 +192,8 @@
strategy:
matrix:
python:
- - short: 38
- dotted: 3.8
+ - short: 39
+ dotted: 3.9
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python.dotted }}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-twisted-1.13.4/README.rst
new/pytest-twisted-1.14.0/README.rst
--- old/pytest-twisted-1.13.4/README.rst 2021-08-31 00:28:40.000000000
+0200
+++ new/pytest-twisted-1.14.0/README.rst 2022-10-16 19:08:31.000000000
+0200
@@ -7,8 +7,8 @@
|PyPI| |Pythons| |Travis| |AppVeyor| |Actions| |Black|
:Authors: Ralf Schmitt, Kyle Altendorf, Victor Titor
-:Version: 1.13.4
-:Date: 2021-08-30
+:Version: 1.14.0
+:Date: 2022-10-16
:Download: https://pypi.python.org/pypi/pytest-twisted#downloads
:Code: https://github.com/pytest-dev/pytest-twisted
@@ -182,6 +182,18 @@
await d2
+Hypothesis
+==========
+pytest-twisted can be used with Hypothesis.
+
+.. code-block:: python
+
+ @hypothesis.given(x=hypothesis.strategies.integers())
+ @pytest_twisted.ensureDeferred
+ async def test_async(x):
+ assert isinstance(x, int)
+
+
The twisted greenlet
====================
Some libraries (e.g. corotwine) need to know the greenlet, which is
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-twisted-1.13.4/pytest_twisted.py
new/pytest-twisted-1.14.0/pytest_twisted.py
--- old/pytest-twisted-1.13.4/pytest_twisted.py 2021-08-31 00:28:40.000000000
+0200
+++ new/pytest-twisted-1.14.0/pytest_twisted.py 2022-10-16 19:08:31.000000000
+0200
@@ -3,6 +3,7 @@
import itertools
import signal
import sys
+import threading
import warnings
import decorator
@@ -200,7 +201,16 @@
return
if not _instances.reactor.running:
- if signal.getsignal(signal.SIGINT) == signal.default_int_handler:
+ if not isinstance(threading.current_thread(), threading._MainThread):
+ warnings.warn(
+ (
+ 'Will not attempt to block Twisted signal configuration'
+ ' since we are not running in the main thread. See'
+ ' https://github.com/pytest-dev/pytest-twisted/issues/153.'
+ ),
+ RuntimeWarning,
+ )
+ elif signal.getsignal(signal.SIGINT) == signal.default_int_handler:
signal.signal(
signal.SIGINT,
functools.partial(signal.default_int_handler),
@@ -365,27 +375,51 @@
# TODO: only handle 'our' tests? what is the point of handling others?
# well, because our interface allowed people to return deferreds
# from arbitrary tests so we kinda have to keep this up for now
- _run_inline_callbacks(_async_pytest_pyfunc_call, pyfuncitem)
- return not None
+ maybe_hypothesis = getattr(pyfuncitem.obj, "hypothesis", None)
+ if maybe_hypothesis is None:
+ _run_inline_callbacks(
+ _async_pytest_pyfunc_call,
+ pyfuncitem,
+ pyfuncitem.obj,
+ {}
+ )
+ result = not None
+ else:
+ hypothesis = maybe_hypothesis
+ f = hypothesis.inner_test
+
+ def inner_test(**kwargs):
+ return _run_inline_callbacks(
+ _async_pytest_pyfunc_call,
+ pyfuncitem,
+ f,
+ kwargs,
+ )
+
+ pyfuncitem.obj.hypothesis.inner_test = inner_test
+ result = None
+
+ return result
@defer.inlineCallbacks
-def _async_pytest_pyfunc_call(pyfuncitem):
+def _async_pytest_pyfunc_call(pyfuncitem, f, kwargs):
"""Run test function."""
- kwargs = {
+ fixture_kwargs = {
name: value
for name, value in pyfuncitem.funcargs.items()
if name in pyfuncitem._fixtureinfo.argnames
}
+ kwargs.update(fixture_kwargs)
- maybe_mark = _get_mark(pyfuncitem.obj)
+ maybe_mark = _get_mark(f)
if maybe_mark == 'async_test':
- result = yield defer.ensureDeferred(pyfuncitem.obj(**kwargs))
+ result = yield defer.ensureDeferred(f(**kwargs))
elif maybe_mark == 'inline_callbacks_test':
- result = yield pyfuncitem.obj(**kwargs)
+ result = yield f(**kwargs)
else:
# TODO: maybe deprecate this
- result = yield pyfuncitem.obj(**kwargs)
+ result = yield f(**kwargs)
defer.returnValue(result)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-twisted-1.13.4/setup.py
new/pytest-twisted-1.14.0/setup.py
--- old/pytest-twisted-1.13.4/setup.py 2021-08-31 00:28:40.000000000 +0200
+++ new/pytest-twisted-1.14.0/setup.py 2022-10-16 19:08:31.000000000 +0200
@@ -5,7 +5,7 @@
setup(
name="pytest-twisted",
- version="1.13.4",
+ version="1.14.0",
description="A twisted plugin for pytest.",
long_description=long_description,
long_description_content_type="text/x-rst",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-twisted-1.13.4/testing/conftest.py
new/pytest-twisted-1.14.0/testing/conftest.py
--- old/pytest-twisted-1.13.4/testing/conftest.py 2021-08-31
00:28:40.000000000 +0200
+++ new/pytest-twisted-1.14.0/testing/conftest.py 2022-10-16
19:08:31.000000000 +0200
@@ -2,7 +2,7 @@
import pytest_twisted
-pytest_plugins = "_pytest.pytester"
+pytest_plugins = "pytester"
@pytest.hookimpl(tryfirst=True)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-twisted-1.13.4/testing/test_basic.py
new/pytest-twisted-1.14.0/testing/test_basic.py
--- old/pytest-twisted-1.13.4/testing/test_basic.py 2021-08-31
00:28:40.000000000 +0200
+++ new/pytest-twisted-1.14.0/testing/test_basic.py 2022-10-16
19:08:31.000000000 +0200
@@ -93,6 +93,21 @@
)
+def skip_if_hypothesis_unavailable():
+ def hypothesis_unavailable():
+ try:
+ import hypothesis # noqa: F401
+ except ImportError:
+ return True
+
+ return False
+
+ return pytest.mark.skipif(
+ hypothesis_unavailable(),
+ reason="hypothesis not installed",
+ )
+
+
@pytest.fixture
def cmd_opts(request):
reactor = request.config.getoption("reactor", "default")
@@ -1255,3 +1270,81 @@
rr.stdout.no_re_match_line(pat=pattern)
else:
assert re.match(pattern, rr.stdout.str()) is None
+
+
+@skip_if_no_async_await()
+@skip_if_hypothesis_unavailable()
+def test_hypothesis_async_passes(testdir, cmd_opts):
+ test_file = """
+ import hypothesis
+ import hypothesis.strategies
+
+ import pytest_twisted
+
+ @hypothesis.given(x=hypothesis.strategies.integers())
+ @pytest_twisted.ensureDeferred
+ async def test_async(x):
+ assert isinstance(x, int)
+ """
+ testdir.makepyfile(test_file)
+ rr = testdir.run(*cmd_opts, timeout=timeout)
+ assert_outcomes(rr, {"passed": 1})
+
+
+@skip_if_hypothesis_unavailable()
+def test_hypothesis_inline_callbacks_passes(testdir, cmd_opts):
+ test_file = """
+ import hypothesis
+ import hypothesis.strategies
+
+ import pytest_twisted
+
+ @hypothesis.given(x=hypothesis.strategies.integers())
+ @pytest_twisted.inlineCallbacks
+ def test_inline_callbacks(x):
+ assert isinstance(x, int)
+ return
+ yield
+ """
+ testdir.makepyfile(test_file)
+ rr = testdir.run(*cmd_opts, timeout=timeout)
+ assert_outcomes(rr, {"passed": 1})
+
+
+@skip_if_no_async_await()
+@skip_if_hypothesis_unavailable()
+def test_hypothesis_async_fails(testdir, cmd_opts):
+ test_file = """
+ import hypothesis
+ import hypothesis.strategies
+
+ import pytest_twisted
+
+ @hypothesis.given(x=hypothesis.strategies.integers())
+ @pytest_twisted.ensureDeferred
+ async def test_async(x):
+ assert isinstance(x, str)
+ """
+ testdir.makepyfile(test_file)
+ rr = testdir.run(*cmd_opts, timeout=timeout)
+ assert_outcomes(rr, {"failed": 1})
+
+
+@skip_if_hypothesis_unavailable()
+def test_hypothesis_inline_callbacks_fails(testdir, cmd_opts):
+ test_file = """
+ import hypothesis
+ import hypothesis.strategies
+
+ import pytest_twisted
+
+ @hypothesis.given(x=hypothesis.strategies.integers())
+ @pytest_twisted.inlineCallbacks
+ def test_inline_callbacks(x):
+ assert isinstance(x, str)
+ return
+ yield
+ """
+ testdir.makepyfile(test_file)
+ rr = testdir.run(*cmd_opts, timeout=timeout)
+ assert_outcomes(rr, {"failed": 1})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-twisted-1.13.4/tox.ini
new/pytest-twisted-1.14.0/tox.ini
--- old/pytest-twisted-1.13.4/tox.ini 2021-08-31 00:28:40.000000000 +0200
+++ new/pytest-twisted-1.14.0/tox.ini 2022-10-16 19:08:31.000000000 +0200
@@ -1,9 +1,9 @@
[tox]
envlist=
- py{27,py27,35,36,37,38,39,py36,py37}-defaultreactor
- py{35,36,37,38,39,py36,py37}-asyncioreactor
- py{35,36,37,38,39}-pyqt5reactor
- py{35,36,37,38,39}-pyside2reactor
+ py{27,py27,35,36,37,38,39,310,py37,py38}-defaultreactor
+ py{35,36,37,38,39,310,py37,py38}-asyncioreactor
+ py{35,36,37,38,39,310}-pyqt5reactor
+ py{35,36,37,38,39,310}-pyside2reactor
linting
[testenv]
@@ -11,6 +11,7 @@
greenlet
pytest
twisted
+ py37,py38,py39,pypy37,pypy38: hypothesis
pyqt5reactor,pyside2reactor: pytest-qt
pyqt5reactor,pyside2reactor: pytest-xvfb
pyqt5reactor,pyside2reactor: pywin32; sys_platform == 'win32'