-
Notifications
You must be signed in to change notification settings - Fork 6
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
support testsetup #5
Comments
No there is unfortunately no workaround. In the coming days I'll clean up the existing implementation first and then I'll implement support for testsetup. Since you are also interested in support for more flags, maybe you can try to contibute and add support for pyversion and skipif. That would be great. |
I was wondering if there were any updates. Maybe I need much less (I'm not so familiar with sphinx+doctest): My issue is that I have a function that is defined in the guide *.rst file, and I'd like to use it. Right now I am including a module with such function in the code base, including such module in the conf.py |
No currently not. I'll have a look at the testsetup code again, once I'm done with the support for ":skipif:" option. |
@Thisch thank you. Sorry, just to understand: |
Your described behavior is definitely a bug. I don't yet have an idea how to implement/fix it, because it requires that we share data between pytest test-items. |
@nathanshammah Please take a look at #23. You can move the code block from Does this solve some of you issues? |
The # conftest.py
@pytest.fixture(autouse=True)
def add_doctest_globals(doctest_namespace):
doctest_namespace['foo'] = False # test.rst
.. testcode::
:skipif: not foo
42 $ pytest --doctest-glob='*.rst'
...
ERROR test.rst - NameError: name 'foo' is not defined |
Hey @Thisch! We're considering using pytest-sphinx for https://github.com/ray-project/ray. Do you know if support for |
Hi! That's great news! Currently support for |
I saw in the README that support for
testsetup
is planned but didn't see an issue to track it, so thought I'd create one and register interest to boot.Is there a workaround you would recommend in the meantime?
Thanks for maintaining pytest-sphinx!
The text was updated successfully, but these errors were encountered: