2 Commits

Author SHA256 Message Date
e1565da197 Accepting request 1228145 from devel:languages:python:pytest
- Add patch support-python-313.patch:
  * Do not use crypt for testing.
- Switch to pyproject macros.

OBS-URL: https://build.opensuse.org/request/show/1228145
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-testinfra?expand=0&rev=8
2024-12-04 14:27:30 +00:00
06d2e96dae - Add patch support-python-313.patch:
* Do not use crypt for testing.
- Switch to pyproject macros.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-testinfra?expand=0&rev=18
2024-12-04 06:05:03 +00:00
5 changed files with 47 additions and 24 deletions

BIN
pytest-testinfra-10.1.1.tar.gz LFS Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -1,18 +1,3 @@
-------------------------------------------------------------------
Fri Jan 23 04:03:00 UTC 2026 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 10.2.2:
* Remove crypt lib from testing
* Prevent Paramiko deadlock when test sends more than 2MB to stdout
* Extend backend documentation with a general host spec section
* Fix KeyError in MountPoint.repr()
* Fix systemctl is active
* Extended testing of group_names
* Query all usernames and group names
* Use builtin dict, list and tuple for typing
* Use hatchling instead of setuptools
- Drop patch support-python-313.patch, included upstream.
-------------------------------------------------------------------
Wed Dec 4 06:04:30 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>

View File

@@ -18,21 +18,24 @@
%{?sle15_python_module_pythons}
Name: python-pytest-testinfra
Version: 10.2.2
Version: 10.1.1
Release: 0
Summary: Python module to test infrastructures
License: Apache-2.0
URL: https://github.com/pytest-dev/pytest-testinfra
Source: https://files.pythonhosted.org/packages/source/p/pytest-testinfra/pytest_testinfra-%{version}.tar.gz
Source: https://files.pythonhosted.org/packages/source/p/pytest-testinfra/pytest-testinfra-%{version}.tar.gz
# PATCH-FIX-OPENSUSE testinfra-parametrize-backends-test.patch -- make backends deselectable which are not available for testing
Patch0: testinfra-parametrize-backends-test.patch
# PATCH-FIX-UPSTREAM gh#pytest-dev/pytest-testinfra#764
Patch1: support-python-313.patch
BuildRequires: %{python_module paramiko}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module pywinrm}
BuildRequires: %{python_module hatchling}
BuildRequires: %{python_module hatch-vcs}
BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module tornado}
BuildRequires: %{python_module wheel}
BuildRequires: ansible
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@@ -52,7 +55,11 @@ Testinfra is like a Serverspec equivalent in Python, and is written
as a plugin to the Pytest test engine.
%prep
%autosetup -p1 -n pytest_testinfra-%{version}
%autosetup -p1 -n pytest-testinfra-%{version}
# register custom markers for test suite in order to avoid warning clutter
sed -i -e '/\[tool:pytest\]/ a markers = \
testinfra_hosts\
destructive' setup.cfg
%build
%pyproject_wheel
@@ -72,7 +79,7 @@ fi
%pytest -ra -k "not ($donttest ${$python_donttest})" test
%files %{python_files}
%doc README.rst
%doc CHANGELOG.rst README.rst
%license LICENSE
%{python_sitelib}/testinfra
%{python_sitelib}/pytest_testinfra-%{version}.dist-info

31
support-python-313.patch Normal file
View File

@@ -0,0 +1,31 @@
From 20ef83970b24cd53ce7f5bf952360d8b99a0b7de Mon Sep 17 00:00:00 2001
From: Martin Hoyer <mhoyer@redhat.com>
Date: Tue, 7 May 2024 15:55:07 +0200
Subject: [PATCH] Remove crypt lib from testing
---
test/test_modules.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/test_modules.py b/test/test_modules.py
index 23a1f2f2..15416344 100644
--- a/test/test_modules.py
+++ b/test/test_modules.py
@@ -10,7 +10,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import crypt
import datetime
import os
import re
@@ -257,7 +256,8 @@ def test_nonexistent_user(host):
def test_current_user(host):
assert host.user().name == "root"
pw = host.user().password
- assert crypt.crypt("foo", pw) == pw
+ assert pw.startswith("$")
+ assert len(pw) == 73
def test_group(host):