{"action":"opened","issue":{"url":"https://api.github.com/repos/pytest-dev/pytest/issues/4274","repository_url":"https://api.github.com/repos/pytest-dev/pytest","labels_url":"https://api.github.com/repos/pytest-dev/pytest/issues/4274/labels{/name}","comments_url":"https://api.github.com/repos/pytest-dev/pytest/issues/4274/comments","events_url":"https://api.github.com/repos/pytest-dev/pytest/issues/4274/events","html_url":"https://github.com/pytest-dev/pytest/issues/4274","id":375765156,"node_id":"MDU6SXNzdWUzNzU3NjUxNTY=","number":4274,"title":"Support a --sphinx-doctest option","user":{"login":"jab","id":64992,"node_id":"MDQ6VXNlcjY0OTky","avatar_url":"https://avatars1.githubusercontent.com/u/64992?v=4","gravatar_id":"","url":"https://api.github.com/users/jab","html_url":"https://github.com/jab","followers_url":"https://api.github.com/users/jab/followers","following_url":"https://api.github.com/users/jab/following{/other_user}","gists_url":"https://api.github.com/users/jab/gists{/gist_id}","starred_url":"https://api.github.com/users/jab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jab/subscriptions","organizations_url":"https://api.github.com/users/jab/orgs","repos_url":"https://api.github.com/users/jab/repos","events_url":"https://api.github.com/users/jab/events{/privacy}","received_events_url":"https://api.github.com/users/jab/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-31T01:53:49Z","updated_at":"2018-10-31T01:53:49Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"*(Split off #2514)*\r\n\r\nI love the convenience of being able to invoke a single, well-configured `pytest` command to run all of the many tests in my project, including the example code in my Sphinx docs. (I even contributed #1255 to improve support for this:)\r\n\r\nBut a couple of the missing [sphinx doctest features](http://www.sphinx-doc.org/en/master/usage/extensions/doctest.html) are becoming show-stoppers. (Specifically pyversion, skipif, and testsetup. Happy to explain why if that'd be helpful. I think my use case is pretty typical.)\r\n\r\nBut given that Sphinx already supports all of these with its own `make doctest` command, I'd be plenty happy if `pytest` would just let me pass it some `--sphinx-doctest=path/to/docs` option, to have it shell out to Sphinx's own `make doctest` command as part of what happens when I run `pytest`. As long as pytest made sure to exit nonzero if `make doctest` exited nonzero, and had no other integration, I think it'd still be a win over what pytest currently supports via `--doctest-glob`.\r\n\r\nSuch a `--sphinx-doctest` option seems simple to implement, and would not impose much maintenance burden. It's just a matter of gluing a command line option to a `subprocess.run()` call.\r\n\r\nWould you consider accepting a PR that implemented this?\r\n\r\n(I am aware of the https://github.com/thisch/pytest-sphinx plugin, but it is still missing some of these features too, and it could be worth avoiding an extra plugin dependency since Sphinx already does what we need.)\r\n\r\nThanks for your consideration, and for the great work on pytest!"}}
{"actor":{"display_login":"jab"}}