Skip to content

Document [pytest] configuration in pytest.toml / .pytest.toml #261

Description

@paduszyk

The README documents two configuration styles:

  • [tool.pytest_env] for pyproject.toml
  • [pytest_env] for pytest.toml / .pytest.toml

However, pytest.toml and .pytest.toml can also contain pytest configuration directly under the [pytest] table, and pytest-env options can be configured there, for example:

[pytest]
env = [
    "HOME=~/tmp",
    "RUN_ENV=test",
]

The current INI configuration format section shows the equivalent configuration for pytest.ini and pyproject.toml, but does not show or mention the pytest.toml / .pytest.toml form.

It would be useful to document this explicitly, so users do not get the impression that pytest.toml must use the plugin-specific [pytest_env] table.

For example, the INI-style section could include:

# pytest.toml / .pytest.toml
[pytest]
env = [
    "HOME=~/tmp",
    "RUN_ENV=test",
]

This would also clarify the distinction between the plugin-specific [pytest_env] TOML format and pytest-native configuration passed through [pytest].

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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