Errors when run doctests
Closed this issue · 2 comments
bigfang commented
pytest-it is my missing pytest plugin,I install the github version
pip install git+https://github.com/mattduck/pytest-it.git
and found it work fine if without doctests,
error message
$ pytest --it --doctest-modules
============================= test session starts ==============================
platform darwin -- Python 3.7.3, pytest-4.6.2, py-1.8.0, pluggy-0.12.0
rootdir: /Users/fang/repo/horn-py, inifile: setup.cfg, testpaths: horn, tests
plugins: it-0.1, cov-2.7.1, spec-1.1.0
* horn/tpl.py...
�[92m- ✓�[0m horn.tpl.merge_fields
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/_pytest/main.py", line 206, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/_pytest/main.py", line 250, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/pluggy/hooks.py", line 289, in __call__
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/pluggy/manager.py", line 87, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/pluggy/manager.py", line 81, in <lambda>
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/pluggy/callers.py", line 203, in _multicall
INTERNALERROR> gen.send(outcome)
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/_pytest/main.py", line 271, in pytest_runtestloop
INTERNALERROR> item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/pluggy/hooks.py", line 289, in __call__
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/pluggy/manager.py", line 87, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/pluggy/manager.py", line 81, in <lambda>
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/_pytest/runner.py", line 78, in pytest_runtest_protocol
INTERNALERROR> runtestprotocol(item, nextitem=nextitem)
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/_pytest/runner.py", line 93, in runtestprotocol
INTERNALERROR> reports.append(call_and_report(item, "call", log))
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/_pytest/runner.py", line 177, in call_and_report
INTERNALERROR> hook.pytest_runtest_logreport(report=report)
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/pluggy/hooks.py", line 289, in __call__
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/pluggy/manager.py", line 87, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/pluggy/manager.py", line 81, in <lambda>
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/pytest_it/plugin.py", line 226, in pytest_runtest_logreport
INTERNALERROR> item.reconcile_and_print(self._prev_item, self._tw, report.outcome)
INTERNALERROR> File "/Users/fang/.local/share/virtualenvs/horn-py-avlOfzi3/lib/python3.7/site-packages/pytest_it/plugin.py", line 137, in reconcile_and_print
INTERNALERROR> is_first_module_test = self._item.module != prev._item.module
INTERNALERROR> AttributeError: 'DoctestItem' object has no attribute 'module'
=========================== 2 passed in 0.24 seconds ===========================
mattduck commented
Hi! Sorry, I completely missed this issue - forgot to watch the Github repo when I first created it so I didn't get a notification.
Thanks for the report - I will look into it.