pytest-plugins icon indicating copy to clipboard operation
pytest-plugins copied to clipboard

Incompatible with Python 3.10

Open mcepl opened this issue 2 years ago • 5 comments

Python 3.10 finally really eliminated all those classes in collections package which were long time ago moved to collections.abc. So, from collections import Iterable truly ceased to work.

This patch:

---
 pytest_verbose_parametrize.py |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/pytest_verbose_parametrize.py
+++ b/pytest_verbose_parametrize.py
@@ -1,4 +1,7 @@
-from collections import Iterable
+try:
+    from collections.abc import Iterable
+except (ImportError, ModuleNotFoundError):
+    from collections import Iterable
 from six import string_types, text_type

fixes the problem.

mcepl avatar Jan 10 '22 16:01 mcepl