Skip to content
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

issue with doctests, how to disable testinfra pluggin #267

Closed
gohierf opened this issue Nov 21, 2017 · 1 comment
Closed

issue with doctests, how to disable testinfra pluggin #267

gohierf opened this issue Nov 21, 2017 · 1 comment

Comments

@gohierf
Copy link

gohierf commented Nov 21, 2017

Hello,
I get the following error while trying to run doctests through pytest, apparently due to the testinfra pluging.
Yet I can't seem to be able to disable the plugin.
I'm doing anything wrong or is this an issue from testinfra ?

$ pytest -p no:testinfra-1.9.0 --doctest-modules
================================================================================================================================== test session starts ===================================================================================================================================
platform linux2 -- Python 2.7.5, pytest-3.2.3, py-1.4.34, pluggy-0.4.0
rootdir: /home/fgohier/development/duplicate_repos, inifile:
plugins: testinfra-1.9.0
collected 10 items                                                                                                                                                                                                                                                                        
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/usr/lib/python2.7/site-packages/_pytest/main.py", line 110, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/usr/lib/python2.7/site-packages/_pytest/main.py", line 145, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>   File "/usr/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 745, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/usr/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 339, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/usr/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 334, in <lambda>
INTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR>   File "/usr/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 614, in execute
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/lib/python2.7/site-packages/_pytest/main.py", line 155, in pytest_collection
INTERNALERROR>     return session.perform_collect()
INTERNALERROR>   File "/usr/lib/python2.7/site-packages/_pytest/main.py", line 650, in perform_collect
INTERNALERROR>     hook.pytest_collection_finish(session=self)
INTERNALERROR>   File "/usr/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 745, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/usr/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 339, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/usr/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 334, in <lambda>
INTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR>   File "/usr/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 614, in execute
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/lib/python2.7/site-packages/testinfra/plugin.py", line 160, in pytest_collection_finish
INTERNALERROR>     deprecated_used |= (set(item.fixturenames) & deprecated_modules)
INTERNALERROR> AttributeError: 'DoctestItem' object has no attribute 'fixturenames'

============================================================================================================================== no tests ran in 0.12 seconds ==============================================================================================================================

I get the same issue with or without -p no:testinfra-1.9.0, which doesn't seem to disable the plugin as I expected it to.
I don't get any issue if I don't try to run my test with --doctest-modules

@philpep
Copy link
Contributor

philpep commented Nov 22, 2017

Hi, thanks for reporting, I proposed a fix in #268 , will be merged as soon as the CI is green.

For the -p no:testinfra not working as expected I think it's a pytest issue, maybe related to pytest-dev/pytest#2920

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants