Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

wheelhouse*/
.vscode/


__pycache__/
47 changes: 47 additions & 0 deletions tests/test_stubs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
"""
Test suite for RDKit Python stub files (.pyi).
"""

from pathlib import Path
import pytest


class TestRDKitStubs:
"""Test RDKit Python stub files and type hints."""

def test_stub_files_exist(self):
"""Test that key .pyi stub files exist in the installation."""
# Try to find stub files in the installed package
try:
import rdkit
rdkit_path = Path(rdkit.__file__).parent.parent
stubs_path = rdkit_path / "rdkit-stubs"

if not stubs_path.exists():
pytest.fail("rdkit-stubs directory not found in installation")

# Check for key stub files
expected_stubs = [
"Chem/__init__.pyi",
"Chem/Descriptors.pyi",
"Chem/rdMolDescriptors.pyi",
"Chem/AllChem.pyi",
]

missing_stubs = []
for stub_file in expected_stubs:
stub_path = stubs_path / stub_file
if not stub_path.exists():
missing_stubs.append(stub_file)

if missing_stubs:
pytest.fail(f"Missing stub files: {missing_stubs}")

except ImportError:
pytest.fail("rdkit package not available for stub testing")