Enable tests properly (this is pytest, not unittest)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-distro?expand=0&rev=11
This commit is contained in:
Matej Cepl 2018-06-13 17:21:24 +00:00 committed by Git OBS Bridge
parent bb5874f9c1
commit 1e406ccb9d
2 changed files with 15 additions and 6 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Jun 13 16:52:25 UTC 2018 - mcepl@suse.com
- Enable tests properly (this is pytest, not unittest),
it is necessary to explicitly set locale to an Unicode one
(https://github.com/nir0s/distro/issues/223)
-------------------------------------------------------------------
Thu May 10 09:42:51 UTC 2018 - sebix+novell.com@sebix.at

View File

@ -25,18 +25,19 @@ Release: 0
Summary: Linux Distribution - a Linux OS platform information API
License: Apache-2.0
Group: Development/Languages/Python
Url: https://github.com/nir0s/distro
URL: https://github.com/nir0s/distro
Source: https://files.pythonhosted.org/packages/source/d/distro/distro-%{version}.tar.gz
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: python-rpm-macros
BuildArch: noarch
# SECTION test
%if %{with test}
BuildRequires: %{python_module flake8}
BuildRequires: %{python_module pytest-cov}
BuildRequires: %{python_module pytest-runner}
BuildRequires: %{python_module pytest}
%endif
# /SECTION
BuildArch: noarch
%python_subpackages
%description
@ -55,11 +56,12 @@ It is a renewed alternative implementation for Python's original platform.linux_
%if %{with test}
%check
%python_exec setup.py test
# Explicit settings of locale is necessary
# https://github.com/nir0s/distro/issues/223
LANG=en_US.utf8 %python_exec setup.py pytest
%endif
%files %{python_files}
%defattr(-,root,root,-)
%doc CHANGELOG.md README.md README.rst
%python3_only %{_bindir}/distro
%{python_sitelib}/*