tholo / pytest-flake8

pytest plugin to run flake8
Other
117 stars 47 forks source link

Implement collect() for Flake8Item #71

Closed thomascobb closed 3 years ago

thomascobb commented 4 years ago

Solves NotImplementedError on python3.8 pytest 6.1 when run on an __init__.py file:

Traceback (most recent call last):
  File "venv/lib/python3.8/site-packages/_pytest/runner.py", line 310, in from_call
    result = func()  # type: Optional[TResult]
  File "venv/lib/python3.8/site-packages/_pytest/runner.py", line 340, in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
  File "venv/lib/python3.8/site-packages/_pytest/nodes.py", line 463, in collect
    raise NotImplementedError("abstract")
NotImplementedError: abstract

Copied from: https://github.com/shopkeep/pytest-black/pull/47

Modified to return iterator to support python2.7