Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a test regression with pybind11 2.11.2, 2.12.1, 2.13.6+ #515

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions tests/test_0_API.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# SPDX-License-Identifier: Apache-2.0
import morphio


def test_doc_exists():
classes = [
morphio.EndoplasmicReticulum,
Expand All @@ -18,8 +17,19 @@ def test_doc_exists():
morphio.mut.Section,
morphio.mut.Soma,
]

# we want to makes sure we never forget to add imports in the morphio.__init__
# however, sometimes pybind adds new functions in that namespace, this is the
# place to explicitly ignore them
ignored_methods = {
"_pybind11_conduit_v1_"
}

for cls in classes:
public_methods = (method for method in dir(cls) if not method[:2] == '__')
public_methods = (
method for method in dir(cls)
if not (method.startswith("__") or method in ignored_methods)
)
for method in public_methods:
assert getattr(cls, method).__doc__, \
'Public method {} of class {} is not documented !'.format(method, cls)
Expand Down
Loading