From 1bf9abc4f2d62cef78cf4c3b4e72b82fe4ff9f53 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Mon, 11 Dec 2017 13:05:06 +0100 Subject: [PATCH 1/2] Configure setup.cfg for pytest python-ldap uses a non-standard configuration for tests. Signed-off-by: Christian Heimes --- .gitignore | 1 + Doc/contributing.rst | 2 +- setup.cfg | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4e261ca4..962248fe 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ __pycache__/ .tox .coverage* !.coveragerc +/.cache # shared libs installed by 'setup.py test' /Lib/*.so* diff --git a/Doc/contributing.rst b/Doc/contributing.rst index 45c40f34..abefc4ad 100644 --- a/Doc/contributing.rst +++ b/Doc/contributing.rst @@ -224,7 +224,7 @@ Run reference leak tests:: $ cd path/to/python-ldap $ /tmp/refleak/bin/pip install --upgrade . - $ /tmp/refleak/bin/pytest -v -R: Tests/t_*.py + $ /tmp/refleak/bin/pytest -v -R: Run ``/tmp/refleak/bin/pip install --upgrade .`` every time a file outside of ``Tests/`` is modified. diff --git a/setup.cfg b/setup.cfg index 34699da5..374dd42e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,3 +35,11 @@ packager = python-ldap team distribution_name = openSUSE 11.x release = 1 doc_files = CHANGES README INSTALL TODO Demo/ + +# pytest, https://docs.pytest.org/en/latest/customize.html +[tool:pytest] +testpaths = Tests +python_files = t_*.py +filterwarnings = + error + ignore::ldap.LDAPBytesWarning From 41c6d3a7f9ac18b2ee62132fb58a5be59edcddd7 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Mon, 11 Dec 2017 13:07:54 +0100 Subject: [PATCH 2/2] Fix test class TestSubschemaUrlfetch must be a subclass of TestCase, not TestSuite. Signed-off-by: Christian Heimes --- Tests/t_ldap_schema_subentry.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tests/t_ldap_schema_subentry.py b/Tests/t_ldap_schema_subentry.py index d406b46a..3c07d35b 100644 --- a/Tests/t_ldap_schema_subentry.py +++ b/Tests/t_ldap_schema_subentry.py @@ -25,6 +25,7 @@ os.path.join(HERE, 'data', 'subschema-openldap-all.ldif'), ) + class TestSubschemaLDIF(unittest.TestCase): """ test ldap.schema.SubSchema with subschema subentries read from LDIF files @@ -49,7 +50,7 @@ def test_subschema_file(self): self.assertEqual(attributetype.oid, oid) -class TestSubschemaUrlfetch(unittest.TestSuite): +class TestSubschemaUrlfetch(unittest.TestCase): def test_urlfetch_file(self): freeipa_uri = 'file://{}'.format(TEST_SUBSCHEMA_FILES[0]) dn, schema = ldap.schema.urlfetch(freeipa_uri) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy