https://pantsbuild.org/ logo
#general
Title
# general
s

silly-queen-7197

02/16/2023, 8:32 PM
How should I go about getting
./pants test
to include doctests? I added
Copy code
python_tests(
    name="tests",
    sources=["*.py"],
)
as a target in my directory and ran
./pants test foobar/:: -- --doctest-modules
but it fails on a bunch of files without tests
b

broad-processor-92400

02/16/2023, 9:01 PM
In case you haven't seen it, https://github.com/pantsbuild/pants/issues/11227 seems to have various discussions. Potentially you could have
sources
be an allowlist of only the files that have doctests (
sources=["has_doctests.py", "also_has.py"]
), or use
!
to exclude ones that don't, as a denylist, (
sources=["*.py", "!no_doctests.py"]
)
👀 1
4 Views