Skip to content

Commit 64a7b29

Browse files
authored
python3Packages.pytest-retry: init at 1.7.0 (NixOS#397198)
2 parents 5099db4 + ba20096 commit 64a7b29

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed

pkgs/development/python-modules/debugpy/default.nix

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
pytestCheckHook,
1212
pytest-xdist,
1313
pytest-timeout,
14+
pytest-retry,
1415
importlib-metadata,
1516
psutil,
1617
untangle,
@@ -99,6 +100,7 @@ buildPythonPackage rec {
99100
pytestCheckHook
100101
pytest-xdist
101102
pytest-timeout
103+
pytest-retry
102104

103105
## Used by test helpers:
104106
importlib-metadata
@@ -129,7 +131,12 @@ buildPythonPackage rec {
129131
'';
130132

131133
# Override default arguments in pytest.ini
132-
pytestFlagsArray = [ "--timeout=0" ];
134+
pytestFlags = [ "--timeout=0" ];
135+
136+
disabledTests = [
137+
# hanging test (flaky)
138+
"test_systemexit"
139+
];
133140

134141
# Fixes hanging tests on Darwin
135142
__darwinAllowLocalNetworking = true;
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
lib,
3+
buildPythonPackage,
4+
fetchFromGitHub,
5+
pytest,
6+
pytestCheckHook,
7+
setuptools,
8+
}:
9+
10+
buildPythonPackage rec {
11+
pname = "pytest-retry";
12+
version = "1.7.0";
13+
pyproject = true;
14+
15+
src = fetchFromGitHub {
16+
owner = "str0zzapreti";
17+
repo = "pytest-retry";
18+
tag = version;
19+
hash = "sha256-Gf+L7zvC1FGAm0Wd6E6fV3KynassoGyHSD0CPgEJ02k=";
20+
};
21+
22+
build-system = [ setuptools ];
23+
24+
dependencies = [ pytest ];
25+
26+
nativeCheckInputs = [ pytestCheckHook ];
27+
28+
pythonImportsCheck = [ "pytest_retry" ];
29+
30+
meta = {
31+
description = "Plugin for retrying flaky tests in CI environments";
32+
longDescription = ''
33+
This plugin adds a decorator to mark tests as flaky: `@pytest.mark.flaky(retries=3, delay=1)`.
34+
'';
35+
homepage = "https://github.com/str0zzapreti/pytest-retry";
36+
changelog = "https://github.com/str0zzapreti/pytest-retry/releases/tag/${src.tag}";
37+
license = lib.licenses.mit;
38+
maintainers = with lib.maintainers; [ fliegendewurst ];
39+
};
40+
}

pkgs/top-level/python-packages.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13660,6 +13660,8 @@ self: super: with self; {
1366013660

1366113661
pytest-responses = callPackage ../development/python-modules/pytest-responses { };
1366213662

13663+
pytest-retry = callPackage ../development/python-modules/pytest-retry { };
13664+
1366313665
pytest-reverse = callPackage ../development/python-modules/pytest-reverse { };
1366413666

1366513667
pytest-ruff = callPackage ../development/python-modules/pytest-ruff { };

0 commit comments

Comments
 (0)