CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-tox-pyenv

tox plugin that makes tox use `pyenv which` to find python executables

Overall
score

98%

Overview
Eval results
Files

task.mdevals/scenario-10/

Custom Tox Plugin with Configuration

Build a tox plugin that adds custom configuration options to control test verbosity. The plugin should allow users to configure verbosity through both command-line arguments and tox.ini configuration, with the command-line taking precedence when both are specified.

Requirements

Your plugin must implement a hook that extends tox's argument parser and configuration system to add verbosity control.

Command-Line Support

Add a command-line flag --verbose-output (short form: -V) that enables verbose test output. By default, verbose output should be disabled.

Configuration File Support

Add a configuration attribute named verbose_output that can be set in the [testenv] section of tox.ini. This attribute should:

  • Accept boolean values (true/false)
  • Default to false if not specified

Plugin Integration Requirements

  • Organize your custom options in a dedicated argument group titled "verbosity plugin options"
  • Use tox's testenv attribute system to register the configuration option
  • Implement postprocessing logic to merge command-line and config file settings, ensuring command-line takes precedence

Test Cases

  • Setting --verbose-output on the command line enables verbose mode regardless of tox.ini settings @test
  • When verbose_output = true is set in tox.ini and no CLI flag is provided, verbose mode is enabled @test
  • When neither CLI flag nor config file setting is provided, verbose mode defaults to disabled @test

Implementation

@generates

API

from tox import hookimpl

@hookimpl
def tox_addoption(parser):
    """Add command line and configuration options for verbosity control."""
    pass

Dependencies { .dependencies }

tox { .dependency }

Provides the plugin system and configuration framework.

Install with Tessl CLI

npx tessl i tessl/pypi-tox-pyenv

tile.json