AttributeError: 'Session' object has no attribute '_setupstate' · Issue #49 · pytest-dev/pytest (original) (raw)

Running py.test inside a directory, only containing conftest.py with the following contents:

def pytest_configure(config):

    import no_such_module
[py27]  ~/pytest-internal-error/ % py.test
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/ralf/local/lib/python2.7/site-packages/pytest-2.1.0.dev3-py2.7.egg/_pytest/main.py", line 62, in wrap_session
INTERNALERROR>     config.pluginmanager.do_configure(config)
INTERNALERROR>   File "/home/ralf/local/lib/python2.7/site-packages/pytest-2.1.0.dev3-py2.7.egg/_pytest/core.py", line 260, in do_configure
INTERNALERROR>     config.hook.pytest_configure(config=self._config)
INTERNALERROR>   File "/home/ralf/local/lib/python2.7/site-packages/pytest-2.1.0.dev3-py2.7.egg/_pytest/core.py", line 412, in __call__
INTERNALERROR>     return self._docall(methods, kwargs)
INTERNALERROR>   File "/home/ralf/local/lib/python2.7/site-packages/pytest-2.1.0.dev3-py2.7.egg/_pytest/core.py", line 423, in _docall
INTERNALERROR>     res = mc.execute()
INTERNALERROR>   File "/home/ralf/local/lib/python2.7/site-packages/pytest-2.1.0.dev3-py2.7.egg/_pytest/core.py", line 341, in execute
INTERNALERROR>     res = method(**kwargs)
INTERNALERROR>   File "/home/ralf/pytest-internal-error/conftest.py", line 2, in pytest_configure
INTERNALERROR>     import no_such_module
INTERNALERROR> ImportError: No module named no_such_module
INTERNALERROR> 
Traceback (most recent call last):
  File "/home/ralf/local/bin/py.test", line 9, in <module>
    load_entry_point('pytest==2.1.0.dev3', 'console_scripts', 'py.test')()
  File "/home/ralf/local/lib/python2.7/site-packages/pytest-2.1.0.dev3-py2.7.egg/_pytest/core.py", line 458, in main
    exitstatus = hook.pytest_cmdline_main(config=config)
  File "/home/ralf/local/lib/python2.7/site-packages/pytest-2.1.0.dev3-py2.7.egg/_pytest/core.py", line 412, in __call__
    return self._docall(methods, kwargs)
  File "/home/ralf/local/lib/python2.7/site-packages/pytest-2.1.0.dev3-py2.7.egg/_pytest/core.py", line 423, in _docall
    res = mc.execute()
  File "/home/ralf/local/lib/python2.7/site-packages/pytest-2.1.0.dev3-py2.7.egg/_pytest/core.py", line 341, in execute
    res = method(**kwargs)
  File "/home/ralf/local/lib/python2.7/site-packages/pytest-2.1.0.dev3-py2.7.egg/_pytest/main.py", line 85, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/home/ralf/local/lib/python2.7/site-packages/pytest-2.1.0.dev3-py2.7.egg/_pytest/main.py", line 80, in wrap_session
    exitstatus=session.exitstatus)
  File "/home/ralf/local/lib/python2.7/site-packages/pytest-2.1.0.dev3-py2.7.egg/_pytest/core.py", line 412, in __call__
    return self._docall(methods, kwargs)
  File "/home/ralf/local/lib/python2.7/site-packages/pytest-2.1.0.dev3-py2.7.egg/_pytest/core.py", line 423, in _docall
    res = mc.execute()
  File "/home/ralf/local/lib/python2.7/site-packages/pytest-2.1.0.dev3-py2.7.egg/_pytest/core.py", line 341, in execute
    res = method(**kwargs)
  File "/home/ralf/local/lib/python2.7/site-packages/pytest-2.1.0.dev3-py2.7.egg/_pytest/runner.py", line 22, in pytest_sessionfinish
    rep = hook.pytest__teardown_final(session=session)
  File "/home/ralf/local/lib/python2.7/site-packages/pytest-2.1.0.dev3-py2.7.egg/_pytest/core.py", line 412, in __call__
    return self._docall(methods, kwargs)
  File "/home/ralf/local/lib/python2.7/site-packages/pytest-2.1.0.dev3-py2.7.egg/_pytest/core.py", line 423, in _docall
    res = mc.execute()
  File "/home/ralf/local/lib/python2.7/site-packages/pytest-2.1.0.dev3-py2.7.egg/_pytest/core.py", line 341, in execute
    res = method(**kwargs)
  File "/home/ralf/local/lib/python2.7/site-packages/pytest-2.1.0.dev3-py2.7.egg/_pytest/capture.py", line 171, in pytest__teardown_final
    rep = __multicall__.execute()
  File "/home/ralf/local/lib/python2.7/site-packages/pytest-2.1.0.dev3-py2.7.egg/_pytest/core.py", line 341, in execute
    res = method(**kwargs)
  File "/home/ralf/local/lib/python2.7/site-packages/pytest-2.1.0.dev3-py2.7.egg/_pytest/runner.py", line 56, in pytest__teardown_final
    call = CallInfo(session._setupstate.teardown_all, when="teardown")
AttributeError: 'Session' object has no attribute '_setupstate'