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 27 28 29 30 31 32
|
From: "Billy K. Poon" <bkpoon@lbl.gov>
Date: Thu, 10 Nov 2022 13:43:40 -0800
Subject: libtbx: update test for Python 3.11
Origin: upstream, https://github.com/cctbx/cctbx_project/commit/c1abc42da889e57665a40b81ad4f76778970a200
---
libtbx/find_reference_cycles.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/libtbx/find_reference_cycles.py b/libtbx/find_reference_cycles.py
index 0579743..9d71a49 100644
--- a/libtbx/find_reference_cycles.py
+++ b/libtbx/find_reference_cycles.py
@@ -91,11 +91,16 @@ def exercise():
# " <class '__main__.bad_class'> -- <__main__.bad_class object at 0xb7eb5d2c> ->"
# " <type 'dict'> -- ->"
# ''
- assert len(lines) == 4
+ # For Python 3.11, the <type 'dict'> line is missing
+ if sys.version_info.major == 3 and sys.version_info.minor >= 11:
+ assert len(lines) == 3
+ else:
+ assert len(lines) == 4
assert lines[0].startswith("Examining: <")
assert lines[0].count("bad_class") == 1
assert lines[1].count("bad_class") == 2
- assert lines[2].count("dict") == 1
+ if sys.version_info.major == 3 and sys.version_info.minor < 11:
+ assert lines[2].count("dict") == 1
print("OK")
|