-
Notifications
You must be signed in to change notification settings - Fork 176
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
Running pytest
locally fails
#871
Comments
Mysterious import errors are sometimes due to import cycles. (Didn't actually look at your code so just guessing)
…On September 3, 2019 8:12:38 PM UTC, "Raphaël Gomès" ***@***.***> wrote:
While working on updating my PR, I wanted to run the test suite locally
after adding a test, and was greeted with the following message:
```
$ pytest -v
ImportError while loading conftest '[...]/asv/test/conftest.py'.
__init__.py:7: in <module>
from asv.console import log
../asv/__init__.py:32: in <module>
from . import plugin_manager
../asv/plugin_manager.py:60: in <module>
plugin_manager.load_plugins(commands)
../asv/plugin_manager.py:30: in load_plugins
__import__(name)
asv/commands/compare_variant.py:17: in <module>
???
E ImportError: cannot import name results_default_iter
```
I have no idea when that issue started. Here is the output of `pip
freeze`:
```
alabaster==0.7.12
asv==0.3.1
atomicwrites==1.3.0
attrs==19.1.0
Babel==2.6.0
certifi==2019.3.9
chardet==3.0.4
docutils==0.14
funcsigs==1.0.2
idna==2.8
imagesize==1.1.0
Jinja2==2.10
MarkupSafe==1.1.1
more-itertools==5.0.0
packaging==19.0
pathlib2==2.3.3
pluggy==0.9.0
py==1.8.0
Pygments==2.3.1
pyparsing==2.3.1
pytest==4.4.0
pytz==2018.9
requests==2.21.0
scandir==1.10.0
six==1.12.0
snowballstemmer==1.2.1
Sphinx==1.8.5
sphinx-bootstrap-theme==0.7.1
sphinxcontrib-websupport==1.1.0
typing==3.6.6
urllib3==1.24.1
```
Note: asv is installed locally as editable.
I am using "Python 2.7.16+".
|
I've checked out the main master branch and still have the same issue. Am I following the right procedure to run tests? |
You can check what tox and travisci do.
…On September 4, 2019 8:34:09 AM UTC, "Raphaël Gomès" ***@***.***> wrote:
I've checked out the main master branch and still have the same issue.
Am I following the right procedure to run tests?
|
I find that I have to specify the test directory, a glob pattern or the specific module that I want to use when running pytest from the command line with asv. e.g.
|
FWIW, for me it works out of the box:
|
I guess you could also try from clean checkout, |
It was indeed some kind of local issue. Note @pv I'm not certain recommending to run Thanks a lot! |
While working on updating my PR, I wanted to run the test suite locally after adding a test, and was greeted with the following message:
I have no idea when that issue started. Here is the output of
pip freeze
:Note: asv is installed locally as editable.
I am using "Python 2.7.16+".
The text was updated successfully, but these errors were encountered: