Skip to content

[BUG] A bug when using with pytest-flake8 #919

@wahzzy

Description

@wahzzy

Describe your context

dash                 1.2.0    
dash-core-components 1.1.2    
dash-html-components 1.0.1    
dash-renderer        1.0.1    
dash-table           4.2.0 

Describe the bug

The bug occurs when using 'pytest --flake' to check on .py files.

$ pytest --flake8
Test session starts (platform: linux, Python 3.6.5, pytest 5.1.2, pytest-sugar 0.9.2)
rootdir: /home/wahchi/Desktop/dash_flake
plugins: dash-1.2.0, flake8-1.0.4, sugar-0.9.2, mock-1.10.4
collecting ... INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/_pytest/main.py", line 191, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/_pytest/main.py", line 235, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/pluggy/hooks.py", line 289, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/pluggy/manager.py", line 87, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/pluggy/manager.py", line 81, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/_pytest/main.py", line 256, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/pluggy/hooks.py", line 289, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/pluggy/manager.py", line 87, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/pluggy/manager.py", line 81, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/_pytest/runner.py", line 72, in pytest_runtest_protocol
INTERNALERROR>     runtestprotocol(item, nextitem=nextitem)
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/_pytest/runner.py", line 87, in runtestprotocol
INTERNALERROR>     reports.append(call_and_report(item, "call", log))
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/_pytest/runner.py", line 169, in call_and_report
INTERNALERROR>     report = hook.pytest_runtest_makereport(item=item, call=call)
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/pluggy/hooks.py", line 289, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/pluggy/manager.py", line 87, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/pluggy/manager.py", line 81, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/pluggy/callers.py", line 203, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "/home/wahchi/.local/share/virtualenvs/dash_flake-d0L80uXN/lib/python3.6/site-packages/dash/testing/plugin.py", line 65, in pytest_runtest_makereport
INTERNALERROR>     for name, fixture in item.funcargs.items():
INTERNALERROR> AttributeError: 'Flake8Item' object has no attribute 'funcargs'

Expected behavior

I wish Dash can work with pytest-flake8.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions