Skip to content

Commit 2ad72f2

Browse files
tiranencukou
authored andcommitted
Minimal configuration for pytest
Configure setup.cfg for pytest python-ldap uses a non-standard configuration for tests. Also, fix test class: TestSubschemaUrlfetch must be a subclass of TestCase, not TestSuite. #114 Signed-off-by: Christian Heimes <cheimes@redhat.com>
1 parent 44f7ba2 commit 2ad72f2

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ __pycache__/
66
.tox
77
.coverage*
88
!.coveragerc
9+
/.cache
910

1011
# shared libs installed by 'setup.py test'
1112
/Lib/*.so*

Doc/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ Run reference leak tests::
224224

225225
$ cd path/to/python-ldap
226226
$ /tmp/refleak/bin/pip install --upgrade .
227-
$ /tmp/refleak/bin/pytest -v -R: Tests/t_*.py
227+
$ /tmp/refleak/bin/pytest -v -R:
228228

229229
Run ``/tmp/refleak/bin/pip install --upgrade .`` every time a file outside
230230
of ``Tests/`` is modified.

Tests/t_ldap_schema_subentry.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
os.path.join(HERE, 'data', 'subschema-openldap-all.ldif'),
2626
)
2727

28+
2829
class TestSubschemaLDIF(unittest.TestCase):
2930
"""
3031
test ldap.schema.SubSchema with subschema subentries read from LDIF files
@@ -49,7 +50,7 @@ def test_subschema_file(self):
4950
self.assertEqual(attributetype.oid, oid)
5051

5152

52-
class TestSubschemaUrlfetch(unittest.TestSuite):
53+
class TestSubschemaUrlfetch(unittest.TestCase):
5354
def test_urlfetch_file(self):
5455
freeipa_uri = 'file://{}'.format(TEST_SUBSCHEMA_FILES[0])
5556
dn, schema = ldap.schema.urlfetch(freeipa_uri)

setup.cfg

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,11 @@ packager = python-ldap team
3535
distribution_name = openSUSE 11.x
3636
release = 1
3737
doc_files = CHANGES README INSTALL TODO Demo/
38+
39+
# pytest, https://docs.pytest.org/en/latest/customize.html
40+
[tool:pytest]
41+
testpaths = Tests
42+
python_files = t_*.py
43+
filterwarnings =
44+
error
45+
ignore::ldap.LDAPBytesWarning

0 commit comments

Comments
 (0)
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