From ed9a380558e4af67ea2f19b120e2869816cc8c5552651dfbcfb8dc6179b8ce00 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 11 Dec 2019 18:11:07 +0000 Subject: [PATCH] Accepting request 755372 from home:pgajdos - run the testsuite against test mysqld server OBS-URL: https://build.opensuse.org/request/show/755372 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-mysqlclient?expand=0&rev=16 --- python-mysqlclient.changes | 5 +++++ python-mysqlclient.spec | 30 ++++++++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/python-mysqlclient.changes b/python-mysqlclient.changes index 84c7814..fe15b92 100644 --- a/python-mysqlclient.changes +++ b/python-mysqlclient.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Dec 9 20:22:50 UTC 2019 - pgajdos@suse.com + +- run the testsuite against test mysqld server + ------------------------------------------------------------------- Fri Nov 22 17:31:43 UTC 2019 - Alexei Podvalsky diff --git a/python-mysqlclient.spec b/python-mysqlclient.spec index c4c0a0b..b50ec81 100644 --- a/python-mysqlclient.spec +++ b/python-mysqlclient.spec @@ -1,7 +1,7 @@ # # spec file for package python-mysqlclient # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -27,12 +27,15 @@ Group: Development/Languages/Python URL: https://github.com/PyMySQL/mysqlclient-python Source: https://files.pythonhosted.org/packages/source/m/mysqlclient/mysqlclient-%{version}.tar.gz BuildRequires: %{python_module devel} +BuildRequires: %{python_module mock} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} -BuildRequires: python3-attrs BuildRequires: fdupes BuildRequires: libmysqlclient-devel +BuildRequires: mariadb-rpm-macros BuildRequires: python-rpm-macros BuildRequires: python3-Sphinx +BuildRequires: python3-attrs BuildRequires: unzip Recommends: mariadb Provides: python-mysql = %{version} @@ -60,6 +63,29 @@ This package adds Python 3 support and bug fixes to MySQLdb1. python3 setup.py build_sphinx && rm build/sphinx/html/.buildinfo +%check +exit_code=0 +cconf=abuild-myclient.cnf +# +# start the mariadb server +# +%mysql_testserver_start -u abuild -p abuildpw +# +# creating client mysql config +# +%mysql_testserver_cconf -n $cconf +# +# running the test +# +rm -r MySQLdb +export TESTDB="$PWD/$cconf" +%pytest_arch -k "not (test_LONG or test_TEXT)" +# +# stopping mariadb +# +%mysql_testserver_stop +exit $exit_code + %install %python_install %python_expand %fdupes %{buildroot}%{$python_sitearch}