You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Was running pytest 3.10 and now when I try to just run on a module's __init__.py, I'd get an error such as:
$ pytest tests/__init__.py
========================================================= test session starts =========================================================
platform linux -- Python 3.6.7, pytest-3.10.0, py-1.7.0, pluggy-0.8.0
rootdir: /auto/cnvtvws/wlee/fcnvt/blahblah, inifile: setup.cfg
plugins: flake8-1.0.2
collected 0 items / 1 errors
=============================================================== ERRORS ================================================================
__________________________________________________________ ERROR collecting __________________________________________________________
/myenv/miniconda/envs/test_pytest/lib/python3.6/site-packages/_pytest/runner.py:212: in __init__
self.result = func()
/myenv/miniconda/envs/test_pytest/lib/python3.6/site-packages/_pytest/runner.py:272: in <lambda>
call = CallInfo(lambda: list(collector.collect()), "collect")
/myenv/miniconda/envs/test_pytest/lib/python3.6/site-packages/_pytest/main.py:478: in collect
for x in self._collect(arg):
/myenv/miniconda/envs/test_pytest/lib/python3.6/site-packages/_pytest/main.py:568: in _collect
yield next(m[0].collect())
/myenv/miniconda/envs/test_pytest/lib/python3.6/site-packages/_pytest/nodes.py:429: in collect
raise NotImplementedError("abstract")
E NotImplementedError: abstract
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================================= 1 error in 0.17 seconds =======================================================
It seems like there's new code in _pytest/main.py:563 that has something like:
# If __init__.py was the only file requested, then the matched node will be# the corresponding Package, and the first yielded item will be the __init__# Module itself, so just use that. If this special case isn't taken, then all# the files in the package will be yielded.ifargpath.basename=="__init__.py":
yieldnext(m[0].collect())
return
It turns out the m is a list from the previous collect where the first item is actually a Flake8Item. It would not work when you call collect on it. I'm not sure the intention of this extra collect, but should it check if the item isinstance a package?
Was running pytest 3.10 and now when I try to just run on a module's
__init__.py
, I'd get an error such as:It seems like there's new code in _pytest/main.py:563 that has something like:
It turns out the m is a list from the previous collect where the first item is actually a Flake8Item. It would not work when you call collect on it. I'm not sure the intention of this extra collect, but should it check if the item isinstance a package?
pip list:
I'm using conda to install this:
The text was updated successfully, but these errors were encountered: