Accepting request 1157044 from devel:languages:python:pytest

Forwarded request #1156454 from bnavigator

- Fix requirements for python39 (yes really)
  - Make brittle test "fix" depending on the undocumented value of
    unexpanded %python_bin_suffix more robust

OBS-URL: https://build.opensuse.org/request/show/1157044
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-console-scripts?expand=0&rev=13
This commit is contained in:
Ana Guerrero 2024-03-13 21:17:56 +00:00 committed by Git OBS Bridge
commit c5fc834a5c
2 changed files with 20 additions and 9 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Mar 8 20:17:05 UTC 2024 - Ben Greiner <code@bnavigator.de>
- Fix requirements for python39 (yes really)
- Make brittle test "fix" depending on the undocumented value of
unexpanded %python_bin_suffix more robust
-------------------------------------------------------------------
Wed Jul 19 13:34:19 UTC 2023 - ecsos <ecsos@opensuse.org>

View File

@ -1,7 +1,7 @@
#
# spec file for package python-pytest-console-scripts
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -24,14 +24,17 @@ Summary: Pytest plugin for testing console scripts
License: MIT
URL: https://github.com/kvas-it/pytest-console-scripts
Source: https://files.pythonhosted.org/packages/source/p/pytest-console-scripts/pytest-console-scripts-%{version}.tar.gz
BuildRequires: %{python_module importlib-metadata >= 3.6 if %python-base < 3.10}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest >= 4.0.0}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-pytest >= 4.0.0
Requires: (python-importlib-metadata >= 3.6 if python-base < 3.10)
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module pytest >= 4.0.0}
BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module virtualenv >= 20}
# /SECTION
@ -57,17 +60,18 @@ much as possible.
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%if 0%{?suse_version} > 1500
sed -i 's:env python:env python3:' tests/test_run_scripts.py
%else
sed -i 's:env python:env python%{python_bin_suffix}:' tests/test_run_scripts.py
%endif
%pytest
cp tests/test_run_scripts.py template_run_scripts.py
export PYTHONDONTWRITEBYTECODE=1
%{python_expand #
export PYTHONPATH=%{buildroot}%{$python_sitelib}
sed 's|env python|$python|' template_run_scripts.py > tests/test_run_scripts.py
$python -m pytest -v
}
%files %{python_files}
%license LICENSE
%doc README.md
%{python_sitelib}/pytest_console_scripts
%{python_sitelib}/pytest_console_scripts-%{version}*-info
%{python_sitelib}/pytest_console_scripts-%{version}.dist-info
%changelog