diff --git a/python-ldap3.changes b/python-ldap3.changes index d2b8322..9b118e5 100644 --- a/python-ldap3.changes +++ b/python-ldap3.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Jul 24 00:46:48 UTC 2020 - Matej Cepl + +- Add skip-missing-LDAP-server.patch to skip over tests failing because + of the missing local LDAP server running (gh#cannatag/ldap3#843). + ------------------------------------------------------------------- Fri May 15 15:55:38 UTC 2020 - Antonio Larrosa diff --git a/python-ldap3.spec b/python-ldap3.spec index c62e099..fd7b0c4 100644 --- a/python-ldap3.spec +++ b/python-ldap3.spec @@ -24,8 +24,12 @@ Summary: A strictly RFC 4511 conforming LDAP V3 pure Python client License: LGPL-3.0-only URL: https://github.com/cannatag/ldap3 Source: https://github.com/cannatag/ldap3/archive/v%{version}.tar.gz -BuildRequires: %{python_module nose} +# PATCH-FIX-UPSTREAM skip-missing-LDAP-server.patch gh#cannatag/ldap3#843 mcepl@suse.com +# skip over tests failing because of the missing local LDAP server running +Patch0: skip-missing-LDAP-server.patch +# BuildRequires: %%{python_module nose} BuildRequires: %{python_module pyasn1 >= 0.4.6} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: dos2unix BuildRequires: fdupes @@ -44,6 +48,8 @@ The name has been changed to avoid confusion with the python-ldap library. %prep %setup -q -n ldap3-%{version} +%autopatch -p1 + dos2unix COPYING.LESSER.txt COPYING.txt README.rst LICENSE.txt %build @@ -54,7 +60,8 @@ dos2unix COPYING.LESSER.txt COPYING.txt README.rst LICENSE.txt %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%python_exec %{_bindir}/nosetests -s test || : +export STRATEGY=SYNC SERVER=EDIR DECODER=INTERNAL +%pytest test/test*.py %files %{python_files} %license COPYING.LESSER.txt COPYING.txt LICENSE.txt diff --git a/skip-missing-LDAP-server.patch b/skip-missing-LDAP-server.patch new file mode 100644 index 0000000..ad9b5df --- /dev/null +++ b/skip-missing-LDAP-server.patch @@ -0,0 +1,19 @@ +--- a/test/config.py ++++ b/test/config.py +@@ -25,6 +25,7 @@ from os import environ, remove + from os import path + from random import SystemRandom + from tempfile import gettempdir ++from unittest import SkipTest + + from ldap3 import SIMPLE, SYNC, ROUND_ROBIN, IP_V6_PREFERRED, IP_SYSTEM_DEFAULT, Server, Connection,\ + ServerPool, SASL, STRING_TYPES, get_config_parameter, set_config_parameter, \ +@@ -380,7 +381,7 @@ elif location == 'W10GC9227-AD': + test_logging_filename = path.join(gettempdir(), 'ldap3.log') + test_valid_names = ['10.160.201.232'] + else: +- raise Exception('testing location ' + location + ' is not valid') ++ raise SkipTest('testing location ' + location + ' is not valid') + + if test_logging: + try: