-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
pytest 5.0.1 cannot start with Python 3.5.2 #5594
Comments
CC @Zac-HD |
Are you sure you're running a released version of python3.5?
$ git log -G allow_abbrev # while on the 3.5 branch of cpython
...
commit 8089cd642fa8b29e852506218b6355be064c2bd5
Author: Berker Peksag <berker.peksag@gmail.com>
Date: Sat Feb 14 01:39:17 2015 +0200
Issue #14910: Add allow_abbrev parameter to argparse.ArgumentParser.
Patch by Jonathan Paugh, Steven Bethard, paul j3 and Daniel Eriksson.
$ git describe --contains 8089cd642fa8b29e852506218b6355be064c2bd5
v3.5.0a2~158 |
I cannot reproduce with 3.5.2: root@fe033779f895:/# python --version
Python 3.5.2
root@fe033779f895:/# pytest t.py
============================= test session starts ==============================
platform linux -- Python 3.5.2, pytest-5.0.1, py-1.8.0, pluggy-0.12.0
rootdir: /
collected 1 item
t.py . [100%]
=========================== 1 passed in 0.03 seconds =========================== nor with 3.5.0: root@b014377c2521:/# python --version
Python 3.5.0
root@b014377c2521:/# pytest t.py
============================= test session starts ==============================
platform linux -- Python 3.5.0, pytest-5.0.1, py-1.8.0, pluggy-0.12.0
rootdir: /
collected 1 item
t.py . [100%]
=========================== 1 passed in 0.03 seconds =========================== |
@hexaclock I suspect you have either a poisoned could you provide reproduction steps? |
closing as invalid -- if you have reproduction steps please comment back and it can be reopened |
I just got this with Python 3.7, but I have no idea why. As I'm about to reinstall everything and I might never see it again, here it is:
|
I had the Python 2 argparse port sitting in my python 3.7 venv. just a heads up this might cause confusion. |
even with that I can't reproduce :S $ pip install pytest argparse
Requirement already satisfied: pytest in ./venv/lib/python3.6/site-packages (5.0.1)
Requirement already satisfied: argparse in ./venv/lib/python3.6/site-packages (1.4.0)
Requirement already satisfied: pluggy<1.0,>=0.12 in ./venv/lib/python3.6/site-packages (from pytest) (0.12.0)
Requirement already satisfied: py>=1.5.0 in ./venv/lib/python3.6/site-packages (from pytest) (1.8.0)
Requirement already satisfied: wcwidth in ./venv/lib/python3.6/site-packages (from pytest) (0.1.7)
Requirement already satisfied: importlib-metadata>=0.12 in ./venv/lib/python3.6/site-packages (from pytest) (0.18)
Requirement already satisfied: attrs>=17.4.0 in ./venv/lib/python3.6/site-packages (from pytest) (19.1.0)
Requirement already satisfied: packaging in ./venv/lib/python3.6/site-packages (from pytest) (19.0)
Requirement already satisfied: more-itertools>=4.0.0 in ./venv/lib/python3.6/site-packages (from pytest) (7.2.0)
Requirement already satisfied: atomicwrites>=1.0 in ./venv/lib/python3.6/site-packages (from pytest) (1.3.0)
Requirement already satisfied: zipp>=0.5 in ./venv/lib/python3.6/site-packages (from importlib-metadata>=0.12->pytest) (0.5.2)
Requirement already satisfied: six in ./venv/lib/python3.6/site-packages (from packaging->pytest) (1.12.0)
Requirement already satisfied: pyparsing>=2.0.2 in ./venv/lib/python3.6/site-packages (from packaging->pytest) (2.4.1)
$ pytest t.py -n auto
============================= test session starts ==============================
platform linux -- Python 3.6.8, pytest-5.0.1, py-1.8.0, pluggy-0.12.0
rootdir: /tmp/x
plugins: forked-1.0.2, xdist-1.29.0
gw0 [1] / gw1 [1] / gw2 [1] / gw3 [1] / gw4 [1]
. [100%]
=========================== 1 passed in 0.40 seconds ===========================
|
shrugs maybe it was an old one, dunno |
the closest I can get is $ PYTHONPATH=venv/lib/python3.6/site-packages ./venv/bin/pytest t.py
...
TypeError: __init__() got an unexpected keyword argument 'allow_abbrev' but that's pretty nonsense :S |
Might be a specific interaction between |
@Karel-van-de-Plassche can you provide reproduction steps? |
IDK if it helps or not, but I encountered this problem with pytest 5.2.0 when I pip3 installed an unrelated package which (probably erroneously) installed the 1.4.0 version of argparse over the one installed in the standard library. |
unless you're doing weird things with |
i saw a similar problem, when i had set my PYTHONPATH to the site-packages: like so: |
you should not set |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I had this issue using
Unsetting it fixed the issue in my case |
Commenting out line 387
also |
@denis-bz as stated above, that's impossible unless you're doing hacks with |
@asottile, it's a pip versionitis (version disease) problem
confused pip because 1.4.0 > 1.1 !! I'll raise it there. (I keep all pip installs in PYTHONPATH = /opt/local/py3/lib/python3.7/site-packages |
no it isn't a pip problem, using PYTHONPATH in that way is not recommended and is what is contributing to your problem |
@asottile, would you agree that keeping all pip installs in a separate dir |
@denis-bz on python 3.7 NEVER install argparse, it breaks the world there as for the python layout for installs - i beleive the general suggestion is to use virtualenv, but personally im unfamiliar with osx |
@RonnyPfannschmidt, the old argparse got installed by pip somethingelse long ago, Repeat, old old version 1.4.0, newest version 1.1 is a bug -- whose ? |
@denis-bz under python 3.7 installing |
repeat, yours: don't install it
no I don't agree, that's what virtualenvs are for and your PYTHONPATH hack is going to cause problems (such as the one you're encountering) |
python3 -mpytest -p no:cacheprovider test_example.py
Caused by this commit: d72fb73
It seems allow_abbrev doesn't exist as a valid kwarg to argparse.ArgumentParser in Python 3.5.2:
The text was updated successfully, but these errors were encountered: