Skip to content

Regular prints are non distinguisable from the listing (--info) printout #668

@cnx-tcsikos

Description

@cnx-tcsikos

Hi!
I'm working on integrating testplan support for "Python Test Explorer for VsCode" VsCode extension.
I have encountered a scenario, where a global print("Hello world") in the main test_plan.py file is visible in the listing (--info) printout.
This is corrupting the whole printout, making the parsing unnecessarily hard.

Example:

print("Hello")
@test_plan(name="Test App")
def main(plan):
    plan.add(
        MultiTest(
            name="Test",
            suites=[
                ...
            ]
        )
    )
print("World")

if __name__ == '__main__':
    sys.exit(not main())

python test_plan.py --info pattern-full

Hello
World
<tests>

Proposed solution

  • Special printout before and after printing the tests
    • Eg.: '==DISCOVERED TESTS BEGIN=='

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