Skip to content
This repository was archived by the owner on May 27, 2024. It is now read-only.

Attribute Error while running on Travis CI #8

Open
ksunden opened this issue Jun 8, 2018 · 3 comments
Open

Attribute Error while running on Travis CI #8

ksunden opened this issue Jun 8, 2018 · 3 comments

Comments

@ksunden
Copy link

ksunden commented Jun 8, 2018

INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/_pytest/main.py", line 99, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/_pytest/config.py", line 920, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pluggy/__init__.py", line 628, in call_historic
INTERNALERROR>     res = self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pluggy/__init__.py", line 222, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pluggy/__init__.py", line 216, in <lambda>
INTERNALERROR>     firstresult=hook.spec_opts.get('firstresult'),
INTERNALERROR>   File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pluggy/callers.py", line 201, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pluggy/callers.py", line 76, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pluggy/callers.py", line 180, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/travis/build/wright-group/WrightTools/.eggs/pytest_mp-0.0.4-py3.6.egg/pytest_mp/plugin.py", line 380, in pytest_configure
INTERNALERROR>     mp_reporter = MPTerminalReporter(standard_reporter, manager)
INTERNALERROR>   File "/home/travis/build/wright-group/WrightTools/.eggs/pytest_mp-0.0.4-py3.6.egg/pytest_mp/terminal.py", line 17, in __init__
INTERNALERROR>     self._tw = self.writer = reporter.writer  # some monkeypatching needed to access existing writer
INTERNALERROR> AttributeError: 'TerminalReporter' object has no attribute 'writer'

This error was generated when running with Python 3.6, but not with Python 3.5.

I did not get this error on my local machine (on python 3.6), only on Travis.

Log located here:
https://travis-ci.org/wright-group/WrightTools/builds/389486834

@ksunden
Copy link
Author

ksunden commented Jun 8, 2018

My current best guess versions of Pytest. I will note that there is a comment in the _pytest/terminal.py that says # self.writer will be deprecated in pytest-3.4, however that is there in the pytest 3.6.1 version, so something is amiss there.

perhaps this library should use _tw rather than writer?

@ksunden
Copy link
Author

ksunden commented Jun 8, 2018

pytest-dev/pytest@cf0cac3#diff-8b669271dfb5b91a3cec82b3b1ce2fa1

This commit somewhat explains what happened, but the fate of this attribute long term is a little iffy.

@ksunden
Copy link
Author

ksunden commented Jun 8, 2018

A slight bit more info, the attribute in question was removed accidentally in pytest 3.3.0, but replaced in pytest 3.3.1. They have changed to use _tw internally, but have not removed the writer alias as of yet.

This incompatibility, combined with the uncertainty of how long writer will be around lead me to think the line here should be something along the lines of:

try:
    self._tw = self.writer = reporter.writer  # some monkeypatching needed to access existing writer
except AttributeError:
    self._tw = self.writer = reporter._tw  # writer attribute replaced in some versions of pytest

Either that or setup.py should explicitly disallow the incompatable version of pytest

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

No branches or pull requests

1 participant