File: 0001-test_utils.py-assert_close-more-tolerant-for-boolean.patch

package info (click to toggle)
pytango 10.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,216 kB
  • sloc: python: 28,206; cpp: 16,380; sql: 255; sh: 82; makefile: 43
file content (26 lines) | stat: -rw-r--r-- 986 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From 54faeab3e2e544111098e0a70270927b465cafbd Mon Sep 17 00:00:00 2001
From: matveyev <yury.matveev@desy.de>
Date: Wed, 4 Dec 2024 12:24:01 +0100
Subject: [PATCH] test_utils.py: assert_close more tolerant for booleans

Bug: https://gitlab.com/tango-controls/pytango/-/issues/645
Origin: upstream, https://gitlab.com/tango-controls/pytango/-/merge_requests/769

---
 tango/test_utils.py | 3 +++
 1 file changed, 3 insertions(+)

Index: pytango/tango/test_utils.py
===================================================================
--- pytango.orig/tango/test_utils.py
+++ pytango/tango/test_utils.py
@@ -499,6 +499,9 @@ if pytest:
         elif isinstance(a, (np.bool_, bool)) or isinstance(b, (np.bool_, bool)):
             assert a == b
             return
+        elif isinstance(a, (np.bool_, bool)) or isinstance(b, (np.bool_, bool)):
+            assert a == b
+            return
         try:
             assert a == pytest.approx(b)
         except (ValueError, TypeError):