
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
pytest-custom-nodeid
Advanced tools
Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report
Support custom grouping. {group name}
or {testfile::class}
Rename testcases name and testcases nodeid, support allure report.
The loadscope load policy based on pytest-xdist is used.
Change testcases nodeid and testcases name encoding to UTF-8 and unicode escape
Because when 'pytest xdist' uses' - x '(stops when it fails), if any use case fails, the whole concurrency will stop running
The skip function is supported. The selected group name will skip all the remaining use cases of the group after the first use case of the group fails to run
This function is particularly useful in scenario testing and other test sets where use cases depend on each other,
to avoid failure of previous use cases and unnecessary execution of subsequent use cases
Format:
group_name::ids
pip install pytest-custom-nodeid
command line:pytest --rename={on:off} --skip=group_name --skip-json=absolute_path
options:
--rename
It is used to open the plug-in, rename the marked use cases, code the unmarked use cases only, and close "off" by default--skip
If it fails, the subsequent use case will be skipped. The tag name is needed here.
example: if the tag in IDS is '{login}', the skip tag is '--skip=login`--skip-json
When there are too many tags to be marked, it can be stored in a JSON file.
Here you need to enter the absolute address, which can be used with 'skip'. The two tags will be combinedtip:
{...}
as a marker custom grouping.Skip
and skip-json
are case-sensitive[Chinese](https://github.com/fungaegis/pytest-custom-nodeid
.. code-block:: python
import pytest
@pytest.mark.parametrize("group",
["world", "hello", "hello", "hello", "world", "world"],
ids=["group_4{group_1}", "group_5{group_2}", "group_6{file::class}",
"group_7{group_1}", "group_8{group_2}", "group_9{file::class}"])
def test_05(group):
a = "hello"
assert a == group
cmd line: pytest --rename=on --skip=group_1 --skip=group_2 --skip=file::class -n=auto --dist=loadscope
Skip
marks the group to which the preceding use case fails, causing subsequent use cases to skip
Using the loadscope load policy, because there are three groups, it will be divided into three groups to run concurrently
nodeid will be renamed to
v0.2
Add label alias, fail skip function
v0.3
Add relative address support for skip-json
FAQs
Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report
We found that pytest-custom-nodeid demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.