Remove test-dependency on python-pexpect

Related: rhbz#1950291
This commit is contained in:
Tomas Orsava 2021-06-15 11:37:28 +02:00
parent 6d547f884c
commit d360db448c
2 changed files with 36 additions and 2 deletions

View File

@ -0,0 +1,28 @@
From 787944c580596237b732e227075e9e9e257681a6 Mon Sep 17 00:00:00 2001
From: Tomas Orsava <torsava@redhat.com>
Date: Tue, 15 Jun 2021 11:15:19 +0200
Subject: [PATCH] Remove test-only dependency pexpect
---
test_pytest_timeout.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/test_pytest_timeout.py b/test_pytest_timeout.py
index 16302d7..fe0dd05 100644
--- a/test_pytest_timeout.py
+++ b/test_pytest_timeout.py
@@ -3,7 +3,10 @@ import signal
import sys
import time
-import pexpect
+try:
+ import pexpect
+except ImportError:
+ pexpect = None # does not have spawn :)
import pytest
pytest_plugins = "pytester"
--
2.31.1

View File

@ -2,17 +2,20 @@
Name: python-%{pypi_name}
Version: 1.4.2
Release: 5%{?dist}
Release: 6%{?dist}
Summary: py.test plugin to abort hanging tests
License: MIT
URL: https://github.com/pytest-dev/pytest-timeout
Source0: %{pypi_source}
# This patch skips 3 tests out of 38 because of missing dependency
# python-pexpect in RHEL 9
Patch1: 0001-Remove-test-only-dependency-pexpect.patch
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: %{py3_dist pexpect}
BuildRequires: %{py3_dist pytest} >= 3.6.0
BuildRequires: %{py3_dist setuptools}
@ -50,6 +53,9 @@ Summary: %{summary}
%{python3_sitelib}/__pycache__/pytest_timeout*
%changelog
* Tue Jun 15 2021 Tomas Orsava <torsava@redhat.com> - 1.4.2-6
- Remove test-dependency on python-pexpect
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.4.2-5
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937