From 2116955f055abb9e1edeb28b74fea7e9a3475ada Mon Sep 17 00:00:00 2001 From: "Kevin J. Sung" Date: Wed, 25 Oct 2023 21:12:41 -0400 Subject: [PATCH] enable doctest --- conftest.py | 18 ++++++++++++++++++ tox.ini | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 conftest.py diff --git a/conftest.py b/conftest.py new file mode 100644 index 000000000..b7f607923 --- /dev/null +++ b/conftest.py @@ -0,0 +1,18 @@ +# (C) Copyright IBM 2023. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +import pytest + +import ffsim + + +@pytest.fixture(autouse=True) +def add_ffsim(doctest_namespace): + doctest_namespace["ffsim"] = ffsim diff --git a/tox.ini b/tox.ini index 3c1c9439e..745289bc8 100644 --- a/tox.ini +++ b/tox.ini @@ -15,7 +15,7 @@ wheel_build_env = .pkg extras = dev commands = - pytest tests/ {posargs} + pytest --doctest-modules python/ tests/ {posargs} [testenv:coverage] description = check test coverage