-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
py.test --doctest-modules doesn't skip setup.py #502
Comments
Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42): I guess we cannot just skip any basename |
Original comment by BitBucket: offbyone, GitHub: offbyone: No argument there. There are some useful heuristics that might work, though; you can look for a project root (if so inclined), or maybe take the perspective that any setup.py in the current directory that is not also a package (ie: that doesn't contain init.py) qualifies as a setup.py for the purposes of the plugin. |
Original comment by BitBucket: encukou, GitHub: encukou: Special-casing the project root isn't a good solution IMO. A project can have sub-packages that are to be installed as separate wheels, but these also need need doctests. Would it make sense to use wildcard ignores, e.g. I suppose I can write a plugin for it, if it's not material for mainline pytest. |
Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42): UI wise i usually consider it best if things just work without the need to find and set some option. So what about ignoring "setup.py" files from doctests if it contains "distutils" or "setuptools" as a string? Wouldn't this work for almost every case we discussed so far? (It's a heuristic but only applicable to doctests and we can see if anyone complains and if so add an option i guess). |
#2834 has been merged, so this can be closed, right? |
yup, thanks for the note |
Originally reported by: BitBucket: offbyone, GitHub: offbyone
If I have the following path layout:
I expect
--doctest-modules
not to read in setup.py. I can control it with conftest.py, but that seems a bit iffy. A better way might be to (IF the project is a setuptools package) take advantage of the setuptools project declaration to find the set of modules under test there.In any case,
setup.py
should be skipped.The text was updated successfully, but these errors were encountered: