Skip to content
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.3.2. More itertools problem #9304

Closed
gavrilov-vlad-tim opened this issue Nov 12, 2021 · 4 comments
Closed

pytest 5.3.2. More itertools problem #9304

gavrilov-vlad-tim opened this issue Nov 12, 2021 · 4 comments

Comments

@gavrilov-vlad-tim
Copy link

Starting from today i get syntax error in more_itertools package when try run test with pytest 5.3.2. This happend because pytest 5.3.2 used more_itertools 8.11.0 as requirement. more_itertools of this version used f'string that is not supported python 3.5.

Site Packges

Package            Version
------------------ ---------
attrs              21.2.0
certifi            2021.10.8
chardet            3.0.4
idna               2.8
importlib-metadata 2.1.2
more-itertools     8.11.0
packaging          20.9
pathlib2           2.3.6
pip                20.2.3
pluggy             0.13.1
py                 1.11.0
pyparsing          2.4.7
pytest             5.3.2
redis              3.3.11
requests           2.22.0
setuptools         50.3.0
six                1.16.0
urllib3            1.25.11
wcwidth            0.2.5
wheel              0.35.1
zipp               1.2.0

Pytest version: 3.5.2. System version: python:3.5-slim docker image

Traceback

 collector_1  | Traceback (most recent call last):
 collector_1  |   File "/usr/local/lib/python3.5/runpy.py", line 183, in _run_module_as_main
 collector_1  |     mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
 collector_1  |   File "/usr/local/lib/python3.5/runpy.py", line 142, in _get_module_details
 collector_1  |     return _get_module_details(pkg_main_name, error)
 collector_1  |   File "/usr/local/lib/python3.5/runpy.py", line 109, in _get_module_details
 collector_1  |     __import__(pkg_name)
 collector_1  |   File "/usr/local/lib/python3.5/site-packages/pytest/__init__.py", line 35, in <module>
 collector_1  |     from _pytest.python_api import approx
 collector_1  |   File "/usr/local/lib/python3.5/site-packages/_pytest/python_api.py", line 21, in <module>
 collector_1  |     from more_itertools.more import always_iterable
 collector_1  |   File "/usr/local/lib/python3.5/site-packages/more_itertools/__init__.py", line 1, in <module>
 collector_1  |     from .more import *  # noqa
 collector_1  |   File "/usr/local/lib/python3.5/site-packages/more_itertools/more.py", line 646
 collector_1  |     f'Too few items in iterable (got {item_count})',
 collector_1  |                                                   ^
 collector_1  | SyntaxError: invalid syntax
 tests_collector_1 exited with code 1
@thatisvivek
Copy link

This issue is not related to Pytest. Please upgrade your Python version. F-strings are introduced in Python 3.6 and you are currently using Python 3.5.

@nicoddemus
Copy link
Member

Indeed, it is a known bug in more-itertools: more-itertools/more-itertools#578

Closing, thanks folks. 👍

@nick-youngblut
Copy link

This issue is not related to Pytest. Please upgrade your Python version. F-strings are introduced in Python 3.6 and you are currently using Python 3.5.

This is broken in conda. Conda is installing pytest in Python 3.5 envs, even though there is a conflict.

@nicoddemus
Copy link
Member

@nick-youngblut I suggest to report this in https://github.com/conda-forge/more-itertools-feedstock, as this is not really pytest related. Thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants