1
0
python-pytest-asyncio/python-pytest-asyncio.spec
Steve Kowalik 0a1d6d058d Accepting request 904059 from home:alarrosa:branches:devel:languages:python:pytest
This should fix Staging:F . Or said in another way, it should
fix python-fakeredis failing with:
[   59s] _______________________________ test_ping[fake] ________________________________
[   59s] 
[   59s] r = <async_generator._impl.AsyncGenerator object at 0x7f60c4ede6d8>
[   59s] 
[   59s]     async def test_ping(r):
[   59s] >       pong = await r.ping()
[   59s] E       AttributeError: 'AsyncGenerator' object has no attribute 'ping'
[   59s] 
[   59s] test/test_aioredis.py:45: AttributeError
...

- Add patch to revert a change in 0.15.1 that removed
  async_generator support in upstream together with python 3.5
  support. This revert is needed by python-fakeredis 1.5.2
  * 0001-removed-support-for-python-3.5.patch

OBS-URL: https://build.opensuse.org/request/show/904059
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-asyncio?expand=0&rev=15
2021-07-05 08:53:13 +00:00

70 lines
2.2 KiB
RPMSpec

#
# spec file for package python-pytest-asyncio
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define skip_python2 1
%{?!python_module:%define python_module() python3-%{**}}
Name: python-pytest-asyncio
Version: 0.15.1
Release: 0
Summary: Pytest support for asyncio
License: Apache-2.0
URL: https://github.com/pytest-dev/pytest-asyncio
Source: https://github.com/pytest-dev/pytest-asyncio/archive/v%{version}.tar.gz#/pytest-asyncio-%{version}.tar.gz
Patch0: 0001-removed-support-for-python-3.5.patch
BuildRequires: %{python_module async_generator >= 1.3}
BuildRequires: %{python_module base >= 3.6}
BuildRequires: %{python_module hypothesis >= 5.7.1}
BuildRequires: %{python_module pytest >= 5.4.0}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-pytest >= 5.4.0
BuildArch: noarch
%python_subpackages
%description
pytest-asyncio is a Python library used for testing asyncio code with pytest.
asyncio code is usually written in the form of coroutines, which makes it
slightly more difficult to test using normal testing tools. pytest-asyncio
provides useful fixtures and markers to make testing easier.
%prep
%setup -q -n pytest-asyncio-%{version}
sed -ie '1i# -*- coding: utf-8 -*-' setup.py
%patch0 -p1 -R
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# remove pytest config to not error out on deprecations
rm setup.cfg
%pytest
%files %{python_files}
%doc README.rst
%license LICENSE
%{python_sitelib}/*
%changelog