From 1e406ccb9d353926df1d5199c4c407ffa361afa594f9638cd504846cf271b3eb Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 13 Jun 2018 17:21:24 +0000 Subject: [PATCH] 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 --- python-distro.changes | 7 +++++++ python-distro.spec | 14 ++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/python-distro.changes b/python-distro.changes index a64fc18..b761186 100644 --- a/python-distro.changes +++ b/python-distro.changes @@ -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 diff --git a/python-distro.spec b/python-distro.spec index f6fb57b..23b84ba 100644 --- a/python-distro.spec +++ b/python-distro.spec @@ -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}/*