{"record":{"id":"f4a4e72cdd180df5","repo":"pola-rs/polars","slug":"polars-testing-parametric-requires-the-hypothesis-module","errorCode":null,"errorMessage":"polars.testing.parametric requires the 'hypothesis' module\\nPlease install it using the command: pip install hypothesis","messagePattern":"polars\\.testing\\.parametric requires the 'hypothesis' module\\\\nPlease install it using the command: pip install hypothesis","errorType":"exception","errorClass":"ModuleNotFoundError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/testing/parametric/__init__.py","lineNumber":8,"sourceCode":"from polars._dependencies import _HYPOTHESIS_AVAILABLE\n\nif not _HYPOTHESIS_AVAILABLE:\n    msg = (\n        \"polars.testing.parametric requires the 'hypothesis' module\\n\"\n        \"Please install it using the command: pip install hypothesis\"\n    )\n    raise ModuleNotFoundError(msg)\n\nfrom polars.testing.parametric.profiles import load_profile, set_profile\nfrom polars.testing.parametric.strategies import (\n    column,\n    dataframes,\n    dtypes,\n    lists,\n    series,\n)\n\n__all__ = [\n    # strategies\n    \"dataframes\",\n    \"series\",\n    \"column\",\n    \"dtypes\",\n    \"lists\",\n    # profiles","sourceCodeStart":1,"sourceCodeEnd":26,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/testing/parametric/__init__.py#L1-L26","documentation":"Importing polars.testing.parametric without the optional 'hypothesis' dependency raises ModuleNotFoundError at import time. The parametric testing strategies are built on hypothesis, which polars does not install by default.","triggerScenarios":"import polars.testing.parametric (or `from polars.testing.parametric import dataframes`) in an environment where hypothesis isn't installed; running parametric test suites on a minimal CI image.","commonSituations":"Fresh venv following old docs; CI runner without dev extras; users copying test code that assumes hypothesis from a monorepo with it preinstalled.","solutions":["pip install hypothesis (or pip install 'polars[pytest]' / project dev extras that include it).","Add hypothesis to test requirements (requirements-dev.txt / pyproject optional-dependencies).","Guard tests with pytest.importorskip('polars.testing.parametric') when hypothesis is optional."],"exampleFix":"# before\nfrom polars.testing.parametric import dataframes  # ModuleNotFoundError\n\n# after (shell)\npip install hypothesis\n# then the import works","handlingStrategy":"fallback","validationCode":"import importlib.util\nif importlib.util.find_spec('hypothesis') is None:\n    pytest.skip('hypothesis not installed')","typeGuard":null,"tryCatchPattern":"try:\n    import polars.testing.parametric as ptp\nexcept ModuleNotFoundError:\n    ptp = None\nif ptp is None:\n    pytest.skip('parametric tests require hypothesis')","preventionTips":["Install dev/test extras (pip install 'polars[pytest]' or project dev requirements)","Use pytest.importorskip for optional-dependency test modules","Keep hypothesis in CI dependency locks"],"tags":["polars","testing","optional-dependency","hypothesis"],"backgroundTag":"missing-dependency","analyzedSha":"fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e","analyzedAt":"2026-09-18T22:14:11.667Z","contentChangedAt":"2026-09-18T22:14:11.667Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}