Skip to content

DEFAULT_CONFIG_FILE can cause the tox test suite to fail #3610

@kurtmckee

Description

@kurtmckee

Issue

The tox test suite does not isolate the tests from the user's system, meaning that it's possible for the test suite to load the user's DEFAULT_CONFIG_FILE if it exists.

Environment

Provide at least:

  • OS: Linux
Output of pip list of the host Python, where tox is installed
$ pip list Package Version Editable project location ------------- -------------------------------- ------------------------- cachetools 6.2.0 chardet 5.2.0 colorama 0.4.6 distlib 0.4.0 filelock 3.19.1 packaging 25.0 pip 25.2 platformdirs 4.4.0 pluggy 1.6.0 pyproject-api 1.9.1 setuptools 80.9.0 tox 4.30.3.dev0+g5e0784a7f.d20250917 /home/kurt/dev/pr-tox virtualenv 20.34.0 wheel 0.45.1

Output of running tox

Output of tox -rvv
FAILED ... FAILED tests/config/loader/test_loader.py::test_override_incorrect[-x] - assert not "ROOT: failed to read config file None because File contains no section headers.\nfile: '/home/kurt/.config/tox/config.ini', line: 1\n'[tox\\n'\n" FAILED ...

Minimal example

$ echo '[tox' > ~/.config/tox/config.ini $ tox

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions