Skip to content

runpytest stdout text is getting truncated in ini-options section #3836

@wimglenn

Description

@wimglenn

pytest 3.7.2 / Python 3.7.0 / macOS

When writing a pytest plugin, I want to test the help text generated for the ini options that were added. But I can't because those lines are for some reason truncated to 78 characters.

Here is a minimal example to reproduce the issue:

# test_something.py
pytest_plugins = ["pytester"]

def test_help_text(testdir):
    result = testdir.runpytest('--help')
    trunc_line = 'python_classes (args)    prefixes or glob names for Python test class discover'
    whole_line = 'python_classes (args)    prefixes or glob names for Python test class discovery'
    assert trunc_line in result.stdout.str()
    assert whole_line in result.stdout.str()

Interestingly, not all lines are truncated - the CLI options are wrapped, and the last few lines of output are correctly determining my terminal width and using that. It seems only the section about ini-options is getting truncated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: configrelated to config handling, argument parsing and config filetopic: reportingrelated to terminal output and user-facing messages and errorstype: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions