Giter Site home page Giter Site logo

pytest-custom-scheduling's Introduction

pytest-custom-scheduling: pytest plugin

Support custom grouping. {group name}

Rewrite pytest-xdist pytest_xdist_make_scheduler function, Modify load scheduling.

Rename testcases name and testcases nodeid, support allure report.

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

Format:

  • name: ids
  • nodeid: group_name::ids

支持自定义分组 {分组名}

使用了pytest-xdist的pytest_xdist_make_scheduler规范方法,修改了负载策略.使得其支持自定义分组

对测试用例名和nodeid进行重命名,方便多个参数化运行同一个测试类使用

对测试用例名和nodeid改为UTF-8编码,使其支持显示中文

格式: - 测试名: 进行参数化时的ids参数值 - nodeid: 首字母大写分组名::ids名

install

pip install pytest-custom-scheduling

Usage

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

tip: pytest-xdist must be turned on

小贴士: pytest-xdist启用时才会启用该插件

options:

  • 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

选项:

  • switch: 用于开启该插件,默认为"off"关闭
  • rename: 用于开启重命名,默认为"off"关闭

parametrize函数ids中,使用 {...} 分组标记

支持"{filename::classname}"这种格式进行多级设置

Demo

import pytest


@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

pytest-custom-scheduling's People

Contributors

fungaegis avatar

Stargazers

Nghia avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.