Skip to content

Commit 62cf025

Browse files
authored
[Work Item #16217] Resolved ptest failures in python-fields package (#16075)
1 parent 22ca021 commit 62cf025

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From 04a827245d0054b1138a67c6551d7400d8e3c1d5 Mon Sep 17 00:00:00 2001
2+
From: SumitJenaHCL <v-sumitjena@microsoft.com>
3+
Date: Tue, 24 Feb 2026 13:48:12 +0530
4+
Subject: [PATCH] fix test warnings
5+
6+
---
7+
conftest.py | 6 ++++--
8+
1 file changed, 4 insertions(+), 2 deletions(-)
9+
10+
diff --git a/conftest.py b/conftest.py
11+
index 68e639f..1a8bd54 100644
12+
--- a/conftest.py
13+
+++ b/conftest.py
14+
@@ -1,8 +1,10 @@
15+
import sys
16+
+from pathlib import Path
17+
+
18+
PY3 = sys.version_info[0] >= 3
19+
20+
-def pytest_ignore_collect(path, config):
21+
- basename = path.basename
22+
+def pytest_ignore_collect(collection_path: Path, config):
23+
+ basename = collection_path.name
24+
25+
if not PY3 and "py3" in basename or PY3 and "py2" in basename or 'pytest' in basename:
26+
return True
27+
--
28+
2.45.4
29+

SPECS/python-fields/python-fields.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
Summary: Container class boilerplate killer
33
Name: python-%{srcname}
44
Version: 5.0.0
5-
Release: 10%{?dist}
5+
Release: 11%{?dist}
66
License: BSD
77
Vendor: Microsoft Corporation
88
Distribution: Azure Linux
99
URL: https://github.com/ionelmc/python-fields
1010
Source0: https://github.com/ionelmc/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
1111
# Compatibility with python-sphinx >= 1.3, already applied upstream
1212
Patch0: %{name}-5.0.0-sphinx-1.3.patch
13+
Patch1: 0001-fix-test-warnings.patch
1314
BuildArch: noarch
1415

1516
%description
@@ -94,6 +95,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} \
9495
%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info/
9596

9697
%changelog
98+
* Mon Mar 02 2026 Sumit Jena <v-sumitjena@microsoft.com> - 5.0.0-11
99+
- Added patch to avoid warnings while runnning ptests
100+
97101
* Sun Feb 13 2022 Jon Slobodzian <joslobo@microsoft,.com> - 5.0.0-10
98102
- Add missing build requires on python-devel
99103

0 commit comments

Comments
 (0)