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

flaky makes py.test --pep8 crash. #99

Closed
gbin opened this issue Mar 16, 2016 · 0 comments
Closed

flaky makes py.test --pep8 crash. #99

gbin opened this issue Mar 16, 2016 · 0 comments

Comments

@gbin
Copy link

gbin commented Mar 16, 2016

Initially reported here: errbotio/errbot#672
Similar issue here: #34

(botbot)➜  err-jenkins git:(master) coverage run --source jenkinsBot -m py.test --pep8
================================================= test session starts =================================================
platform linux -- Python 3.4.3, pytest-2.9.0, py-1.4.31, pluggy-0.3.1
rootdir: /home/jtanay/dev/botbot/plugins/err-jenkins, inifile: 
plugins: flaky-3.1.0, cov-2.2.1, xdist-1.14, pep8-1.0.6
collected 12 items 
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/jtanay/.virtualenvs/botbot/lib/python3.4/site-packages/_pytest/main.py", line 94, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/home/jtanay/.virtualenvs/botbot/lib/python3.4/site-packages/_pytest/main.py", line 125, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/home/jtanay/.virtualenvs/botbot/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 724, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/home/jtanay/.virtualenvs/botbot/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/home/jtanay/.virtualenvs/botbot/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 333, in <lambda>
INTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR>   File "/home/jtanay/.virtualenvs/botbot/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 596, in execute
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/jtanay/.virtualenvs/botbot/lib/python3.4/site-packages/_pytest/main.py", line 150, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "/home/jtanay/.virtualenvs/botbot/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 724, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/home/jtanay/.virtualenvs/botbot/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/home/jtanay/.virtualenvs/botbot/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 333, in <lambda>
INTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR>   File "/home/jtanay/.virtualenvs/botbot/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 595, in execute
INTERNALERROR>     return _wrapped_call(hook_impl.function(*args), self.execute)
INTERNALERROR>   File "/home/jtanay/.virtualenvs/botbot/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 253, in _wrapped_call
INTERNALERROR>     return call_outcome.get_result()
INTERNALERROR>   File "/home/jtanay/.virtualenvs/botbot/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 278, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/home/jtanay/.virtualenvs/botbot/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 264, in __init__
INTERNALERROR>     self.result = func()
INTERNALERROR>   File "/home/jtanay/.virtualenvs/botbot/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 596, in execute
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/jtanay/.virtualenvs/botbot/lib/python3.4/site-packages/flaky/flaky_pytest_plugin.py", line 68, in pytest_runtest_protocol
INTERNALERROR>     self._copy_flaky_attributes(item, test_instance)
INTERNALERROR>   File "/home/jtanay/.virtualenvs/botbot/lib/python3.4/site-packages/flaky/_flaky_plugin.py", line 404, in _copy_flaky_attributes
INTERNALERROR>     _, test_callable, _ = cls._get_test_declaration_callable_and_name(test)
INTERNALERROR>   File "/home/jtanay/.virtualenvs/botbot/lib/python3.4/site-packages/flaky/flaky_pytest_plugin.py", line 359, in _get_test_declaration_callable_and_name
INTERNALERROR>     elif hasattr(test.module, callable_name):
INTERNALERROR> AttributeError: 'Pep8Item' object has no attribute 'module'
============================================ no tests ran in 0.94 seconds =============================================
Jeff-Meadows added a commit to Jeff-Meadows/flaky that referenced this issue Jul 21, 2016
Don't assume that pytest Items have a module attribute.
Fixes box#99 Fixes box#101
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

1 participant