tests: Hide intermediate error in output checker

Signed-off-by: xuxinyu <xuxinyu@xfusion.com>
This commit is contained in:
xuxinyu 2023-01-05 20:54:52 +08:00
parent c6d4cfffe2
commit aaf4021092
2 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,39 @@
From 27b618a93ede3df5224d5d7f90155d901029953b Mon Sep 17 00:00:00 2001
From: Benjamin Berg <bberg@redhat.com>
Date: Tue, 10 May 2022 09:50:10 +0200
Subject: [PATCH 04/14] tests: Hide intermediate error in output checker
The output checker raises from an exception handler. Add the appropriate
"from None" to hide that intermediate exception.
---
tests/output_checker.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/output_checker.py b/tests/output_checker.py
index 265e323..d1a8c4c 100644
--- a/tests/output_checker.py
+++ b/tests/output_checker.py
@@ -98,16 +98,16 @@ class OutputChecker(object):
# EOF, throw error
if self._pipe_fd_r == -1:
if failmsg:
- raise AssertionError("No further messages: " % failmsg)
+ raise AssertionError("No further messages: " % failmsg) from None
else:
- raise AssertionError('No client waiting for needle %s' % (str(needle_re)))
+ raise AssertionError('No client waiting for needle %s' % (str(needle_re))) from None
# Check if should wake up
if not self._lines_sem.acquire(timeout = deadline - time.time()):
if failmsg:
- raise AssertionError(failmsg)
+ raise AssertionError(failmsg) from None
else:
- raise AssertionError('Timed out waiting for needle %s (timeout: %0.2f)' % (str(needle_re), timeout))
+ raise AssertionError('Timed out waiting for needle %s (timeout: %0.2f)' % (str(needle_re), timeout)) from None
continue
ret.append(l)
--
2.37.1.windows.1

View File

@ -1,6 +1,6 @@
Name: fprintd Name: fprintd
Version: 1.94.2 Version: 1.94.2
Release: 4 Release: 5
Summary: D-Bus service for Fingerprint reader access Summary: D-Bus service for Fingerprint reader access
License: GPLv2+ License: GPLv2+
@ -10,6 +10,7 @@ ExcludeArch: s390 s390x
Patch0001: 0001-Don-t-try-to-clear-storage-on-devices-without-intern.patch Patch0001: 0001-Don-t-try-to-clear-storage-on-devices-without-intern.patch
Patch0002: 0002-tests-Fix-dbusmock-AddDevice-calls-to-include-option.patch Patch0002: 0002-tests-Fix-dbusmock-AddDevice-calls-to-include-option.patch
Patch0003: 0003-meson-Do-not-hard-require-test-dependencies.patch Patch0003: 0003-meson-Do-not-hard-require-test-dependencies.patch
Patch0004: 0004-tests-Hide-intermediate-error-in-output-checker.patch
BuildRequires: meson BuildRequires: meson
BuildRequires: gcc BuildRequires: gcc
@ -96,6 +97,9 @@ fi
%{_mandir}/man8/pam_fprintd.8.gz %{_mandir}/man8/pam_fprintd.8.gz
%changelog %changelog
* Thu Jan 05 2023 xuxinyu <xuxinyu@xfusion.com> - 1.94.2-5
- tests: Hide intermediate error in output checker
* Thu Jan 05 2023 xuxinyu <xuxinyu@xfusion.com> - 1.94.2-4 * Thu Jan 05 2023 xuxinyu <xuxinyu@xfusion.com> - 1.94.2-4
- meson: Do not hard-require test dependencies - meson: Do not hard-require test dependencies