Skip to main content

Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report

Project description

pytest-custom-scheduling: pytest plugin

Rewrite pytest-xdist pytest_xdist_make_scheduler function, Modify load scheduling.

Support custom grouping.

Rename testcases name and testcases nodeid, support allure report.

Change testcases nodeid and testcases name encoding to UTF-8 and unicode escape

  • name: ids

  • nodeid: group_name::ids


pip install pytest-custom-scheduling


command line:pytest --switch={on:off} --rename={on:off} -n=auto

tip: pytest-xdist must be turned on

  • switch: Used to open plugin, default “off”

  • rename: Used to open rename, default “off”

Use {...} as a marker custom grouping.

Support “{ filename::classname }” format for multi-level settings


import pytest
                         ["group_1", "group_2", "group_3", "group_4", "group_5", "group_6",
                          "group_7", "group_8", "group_9", "group_10", "group_11", "group_12"],
                         ids=["group_1{group_1}", "group_2{group_2}", "group_3{group_3}",
                              "group_4{group_4}", "group_5{group_5}", "group_6{group_6}",
                              "group_7{group_7}", "group_8{group_8}", "group_9{group_9}",
                              "group_10{group_10}", "group_11{group_11}", "group_12{group_12}"])
@pytest.mark.parametrize("group", ["group_4", "group_5", "group_6"],
                         ids=["group_4{group_5}", "group_5{group_5}", "group_6{group_5}"])
def test_05(group):
    a = "hello"
    b = "world"
    assert a == b

cmd line: pytest --switch=on --rename=on -n=auto

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-custom-scheduling-1.1.tar.gz (3.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page