2018-02-26 23:24:25 +01:00
|
|
|
#
|
|
|
|
# spec file for package python-pytest-localserver
|
|
|
|
#
|
2023-01-09 13:23:01 +01:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2018-02-26 23:24:25 +01:00
|
|
|
# Copyright (c) 2015 LISA GmbH, Bingen, Germany.
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2019-02-25 17:54:17 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2018-02-26 23:24:25 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2022-08-01 18:10:18 +02:00
|
|
|
%{?!python_module:%define python_module() python3-%{**}}
|
2022-08-01 10:35:26 +02:00
|
|
|
%define skip_python2 1
|
2023-01-09 13:23:01 +01:00
|
|
|
%bcond_with extras
|
2023-04-24 11:15:45 +02:00
|
|
|
%{?sle15_python_module_pythons}
|
2018-02-26 23:24:25 +01:00
|
|
|
Name: python-pytest-localserver
|
2023-01-09 13:23:01 +01:00
|
|
|
Version: 0.7.0
|
2018-02-26 23:24:25 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: Plugin for py.test to test server connections locally
|
|
|
|
License: MIT
|
2022-08-01 10:35:26 +02:00
|
|
|
URL: https://github.com/pytest-dev/pytest-localserver
|
2018-02-26 23:24:25 +01:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/p/pytest-localserver/pytest-localserver-%{version}.tar.gz
|
2019-02-25 17:54:17 +01:00
|
|
|
BuildRequires: %{python_module Werkzeug >= 0.10}
|
2023-01-09 13:23:01 +01:00
|
|
|
%if %{with extras}
|
2022-08-01 10:35:26 +02:00
|
|
|
BuildRequires: %{python_module aiosmtpd}
|
2023-01-09 13:23:01 +01:00
|
|
|
%endif
|
2022-08-01 18:10:18 +02:00
|
|
|
BuildRequires: %{python_module pip}
|
2019-02-25 17:54:17 +01:00
|
|
|
BuildRequires: %{python_module pytest >= 2.0.0}
|
|
|
|
BuildRequires: %{python_module requests}
|
2022-08-01 18:10:18 +02:00
|
|
|
BuildRequires: %{python_module setuptools >= 42}
|
|
|
|
BuildRequires: %{python_module setuptools_scm >= 3.4.1}
|
|
|
|
BuildRequires: %{python_module wheel}
|
|
|
|
%if 0%{?suse_version} <= 1500
|
|
|
|
# old setuptools_scm[toml] needs explicit extra
|
|
|
|
BuildRequires: %{python_module toml}
|
|
|
|
%endif
|
2018-02-26 23:24:25 +01:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
2019-02-25 17:54:17 +01:00
|
|
|
Requires: python-Werkzeug >= 0.10
|
|
|
|
Requires: python-pytest >= 2.0.0
|
2018-02-26 23:24:25 +01:00
|
|
|
BuildArch: noarch
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
|
|
|
The pytest-localserver package is a plugin for the `pytest`_ testing framework
|
|
|
|
which enables you to test server connections locally.
|
|
|
|
|
|
|
|
Sometimes `monkeypatching`_ ``urllib2.urlopen()`` just does not cut it, for
|
|
|
|
instance if you work with ``urllib2.Request``, define your own openers/handlers
|
|
|
|
or work with ``httplib``. In these cases it may come in handy to have an HTTP
|
|
|
|
server running locally which behaves just like the real thing. Well, look
|
|
|
|
no further!
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n pytest-localserver-%{version}
|
2019-02-25 17:54:17 +01:00
|
|
|
%autopatch -p1
|
2022-08-01 10:35:26 +02:00
|
|
|
sed -i "1d" pytest_localserver/{plugin,smtp}.py
|
2018-02-26 23:24:25 +01:00
|
|
|
|
|
|
|
%build
|
2022-08-01 18:10:18 +02:00
|
|
|
%pyproject_wheel
|
2018-02-26 23:24:25 +01:00
|
|
|
|
|
|
|
%install
|
2022-08-01 18:10:18 +02:00
|
|
|
%pyproject_install
|
2019-02-25 17:54:17 +01:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
|
|
|
%check
|
2022-08-01 10:35:26 +02:00
|
|
|
%pytest
|
2018-02-26 23:24:25 +01:00
|
|
|
|
|
|
|
%files %{python_files}
|
2022-08-01 10:35:26 +02:00
|
|
|
%doc README.rst
|
2018-02-26 23:24:25 +01:00
|
|
|
%license LICENSE
|
|
|
|
%{python_sitelib}/pytest_localserver
|
2022-08-01 18:10:18 +02:00
|
|
|
%{python_sitelib}/pytest_localserver-%{version}*-info
|
2018-02-26 23:24:25 +01:00
|
|
|
|
|
|
|
%changelog
|