pytest-dev / pytest-dev/pytest

error in setup.cfg ("unexpected value continuation") if `pytest.ini` is missing

Open
#8,923 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

topic: config type: bug
Dominant language
Python
Stars
14.5k
Forks
3.4k
Avg merge
2d 9h
Merged PRs (30d)
35

Description

Description:

If running pytest without pytest.ini for following minimal working example, pytest will fail with the error message:

$ pytest
ERROR: /home/fzeiser/met/pytest_error_unexpected_value_continuation/setup.cfg:17: unexpected value continuation

If a pytest.ini is added (remove .bak from the file in the repo), pytest will work as expected. Similarly, if one removes the [options.extras_require] block of setup.cfg, pytest will run as expected.

Overview of files:

├── foo  # package
│   └── __init__.py
├── pytest.ini.bak # remove .bak to get things working 
├── Readme.md
├── setup.cfg # or remove [options.extras_require] block here 
├── setup.py
├── tests
│   └── test_init.py

Environment:

$ pip list
Package       Version
------------- -------
attrs         21.2.0 
iniconfig     1.1.1  
packaging     21.0   
pip           20.0.2 
pkg-resources 0.0.0  
pluggy        0.13.1 
py            1.10.0 
pyparsing     2.4.7  
pytest        6.2.4  # <-- pytest version 
setuptools    44.0.0 
toml          0.10.2 
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.2 LTS
Release:	20.04
Codename:	focal
$ python --version
Python 3.8.10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked minimal working example, especially setup.cfg, pytest.ini.bak, setup.py, and tests/test_init.py. Run pytest with pytest.ini absent, then with it restored and with [options.extras_require] removed, to isolate the configuration-parsing difference. Done means the minimal example runs without the unexpected value continuation error when pytest.ini is missing.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.