forked from pool/python-ansi2html
- Add opensuse-test.patch making the tests work even with
versioned executables in the testing environment (i.e., before the alts scriptlets kick in). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ansi2html?expand=0&rev=19
This commit is contained in:
@@ -26,6 +26,11 @@ License: LGPL-3.0-or-later
|
||||
Group: Development/Languages/Python
|
||||
URL: https://github.com/pycontribs/ansi2html/
|
||||
Source: https://github.com/pycontribs/ansi2html/archive/v%{version}.tar.gz
|
||||
# PATCH-FIX-OPENSUSE opensuse-test.patch bsc#[0-9]+ mcepl@suse.com
|
||||
# Make tests work with versioned executables before alts kick in
|
||||
# If any other test fails, because the executable is not
|
||||
# "ansi2html", replace it with self.cmd_exe
|
||||
Patch0: opensuse-test.patch
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module pytest}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
@@ -45,7 +50,7 @@ Inspired by and developed off of the work of pixelbeat and blackjack.
|
||||
Read the [docs](https://ansi2html.readthedocs.io/) for more informations.
|
||||
|
||||
%prep
|
||||
%setup -q -n ansi2html-%{version}
|
||||
%autosetup -p1 -n ansi2html-%{version}
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
@@ -58,9 +63,10 @@ Read the [docs](https://ansi2html.readthedocs.io/) for more informations.
|
||||
%check
|
||||
# https://github.com/pycontribs/ansi2html/issues/169
|
||||
sed -i 's:from mock:from unittest.mock:' tests/test_ansi2html.py
|
||||
export PATH=$PATH:%{buildroot}%{_bindir}
|
||||
# ansi2html not available (update alternatives); solvable
|
||||
# but it runs just ansi2html --version
|
||||
%pytest -k 'not test_command_script'
|
||||
%pytest
|
||||
|
||||
%pre
|
||||
%python_libalternatives_reset_alternative ansi2html
|
||||
|
||||
Reference in New Issue
Block a user