zopefoundation / BTrees

Other
80 stars 28 forks source link

5.2: pytest fails in 24 units with pytest 8.2.1 (mostly with `AssertionError: TypeError not raised`) #203

Open kloczek opened 3 months ago

kloczek commented 3 months ago

I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

List of installed modules in build env: ```console Package Version ----------------------------- ----------- alabaster 0.7.16 Babel 2.15.0 build 1.2.1 cffi 1.16.0 charset-normalizer 3.3.2 defusedxml 0.7.1 docutils 0.20.1 exceptiongroup 1.1.3 idna 3.7 imagesize 1.4.1 importlib_metadata 7.1.0 iniconfig 2.0.0 installer 0.7.0 Jinja2 3.1.4 jupyterlab_pygments 0.3.0 MarkupSafe 2.1.5 packaging 24.0 persistent 5.2 pluggy 1.5.0 ply 3.11 pycparser 2.22 Pygments 2.18.0 pyproject_hooks 1.0.0 pytest 8.2.1 python-dateutil 2.9.0.post0 repoze.lru 0.7 repoze.sphinx.autointerface 1.0.0 requests 2.32.2 setuptools 69.4.0 snowballstemmer 2.2.0 Sphinx 7.3.7 sphinxcontrib-applehelp 1.0.8 sphinxcontrib-devhelp 1.0.6 sphinxcontrib-htmlhelp 2.0.5 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.7 sphinxcontrib-serializinghtml 1.1.10 tokenize_rt 5.2.0 tomli 2.0.1 transaction 4.0 urllib3 2.2.1 wheel 0.43.0 zipp 3.18.2 zope.event 5.0 zope.interface 6.4.post2 ```

Please let me know if you need more details or want me to perform some diagnostics.

kloczek commented 3 months ago
Here is pytest output: ```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-BTrees-5.2-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-BTrees-5.2-2.fc37.x86_64/usr/lib/python3.10/site-packages + /usr/bin/pytest -ra -m 'not network' --import-mode=importlib ============================= test session starts ============================== platform linux -- Python 3.10.14, pytest-8.2.1, pluggy-1.5.0 rootdir: /home/tkloczko/rpmbuild/BUILD/BTrees-5.2 configfile: pyproject.toml collected 1042 items src/BTrees/tests/test_Length.py ........... [ 1%] src/BTrees/tests/test_OOBTree.py ......s............ss..F............... [ 4%] .s........s...s..........F.....................F.........s.............s [ 11%] .F.........s......s...s......F.............F.....s...................... [ 18%] ..F....s.......s...F.......F.s.............................F...s......s. [ 25%] ..F.......F.s........................... [ 29%] src/BTrees/tests/test__base.py ......................................... [ 33%] ........................................................................ [ 40%] ........................................................................ [ 47%] ........................................................................ [ 54%] ........................................................................ [ 60%] ................................................ [ 65%] src/BTrees/tests/test__datatypes.py ................. [ 67%] src/BTrees/tests/test_btreesubclass.py .... [ 67%] src/BTrees/tests/test_check.py ............................ [ 70%] src/BTrees/tests/test_compile_flags.py . [ 70%] src/BTrees/tests/test_dynamic_btrees.py . [ 70%] src/BTrees/tests/test_fsBTree.py ................ssssssssssssss..F...... [ 74%] ...s.....s....s..s...s....s....F....................F.......s........... [ 81%] .s.F...s.....s...s..s...s......F.............F.....s...........sssssssss [ 88%] ss..F....s.......s...F.......F.s..................s..s.......F...s...... [ 94%] s...F.......F.s..............s..s......... [ 98%] src/BTrees/tests/test_utils.py ........... [100%] =================================== FAILURES =================================== _______ TestAutoOOBTreeOOBTreeTest.testCannotSetArbitraryAttributeOnBase _______ self = @skipOnPurePython def testCannotSetArbitraryAttributeOnBase(self): if 'Py' in self._getTargetClass().__name__: # pure-python classes can have arbitrary attributes self.skipTest("Not on Pure Python.") > with self.assertRaises(TypeError): E AssertionError: TypeError not raised src/BTrees/tests/common.py:157: AssertionError __________________ TestAutoOOBTreeOOBTreeTest.testPurePython ___________________ self = def testPurePython(self): import importlib kind = self._getTargetClass() class_name = kind.__name__ module_name = kind.__module__ module = importlib.import_module(module_name) # If we're in pure python mode, our target class module # should not have an '_' in it (fix_pickle changes the name # to remove the 'Py') # If we're in the C extension mode, our target class # module still doesn't have the _ in it, but we should be able to find # a Py class that's different self.assertNotIn('_', module_name) self.assertIs(getattr(module, class_name), kind) if not _c_optimizations_ignored() and 'Py' not in type(self).__name__: > self.assertIsNot(getattr(module, class_name + 'Py'), kind) E AssertionError: unexpectedly identical: src/BTrees/tests/common.py:245: AssertionError __________ TestAutoOOBTreeOOBTreeTest.testSubclassesCanHaveAttributes __________ self = def testSubclassesCanHaveAttributes(self): # https://github.com/zopefoundation/BTrees/issues/168 class Subclass(self._getTargetClass()): pass Subclass.foo = 1 self.assertIn('foo', Subclass.__dict__) > self.assertNotIn('foo', self._getTargetClass().__dict__) E AssertionError: 'foo' unexpectedly found in mappingproxy({'_to_key': , '_to_value': , 'MERGE': , 'MERGE_WEIGHT': >, 'MERGE_DEFAULT': None, '__module__': 'BTrees.OOBTree', '__doc__': None, '_mapping_type': , '_set_type': , '_bucket_type': , '_BTree_reduce_as': , '_BTree_reduce_up_bound': , '__implemented__': classImplements(OOBTree, IBTree), '__provides__': directlyProvides(OOBTree), 'max_leaf_size': 30, 'max_internal_size': 250, 'foo': 1}) src/BTrees/tests/common.py:150: AssertionError ______ TestAutoOOBucketMappingBase.testCannotSetArbitraryAttributeOnBase _______ self = @skipOnPurePython def testCannotSetArbitraryAttributeOnBase(self): if 'Py' in self._getTargetClass().__name__: # pure-python classes can have arbitrary attributes self.skipTest("Not on Pure Python.") > with self.assertRaises(TypeError): E AssertionError: TypeError not raised src/BTrees/tests/common.py:157: AssertionError __________________ TestAutoOOBucketMappingBase.testPurePython __________________ self = def testPurePython(self): import importlib kind = self._getTargetClass() class_name = kind.__name__ module_name = kind.__module__ module = importlib.import_module(module_name) # If we're in pure python mode, our target class module # should not have an '_' in it (fix_pickle changes the name # to remove the 'Py') # If we're in the C extension mode, our target class # module still doesn't have the _ in it, but we should be able to find # a Py class that's different self.assertNotIn('_', module_name) self.assertIs(getattr(module, class_name), kind) if not _c_optimizations_ignored() and 'Py' not in type(self).__name__: > self.assertIsNot(getattr(module, class_name + 'Py'), kind) E AssertionError: unexpectedly identical: src/BTrees/tests/common.py:245: AssertionError _________ TestAutoOOBucketMappingBase.testSubclassesCanHaveAttributes __________ self = def testSubclassesCanHaveAttributes(self): # https://github.com/zopefoundation/BTrees/issues/168 class Subclass(self._getTargetClass()): pass Subclass.foo = 1 self.assertIn('foo', Subclass.__dict__) > self.assertNotIn('foo', self._getTargetClass().__dict__) E AssertionError: 'foo' unexpectedly found in mappingproxy({'_to_key': , '_to_value': , 'MERGE': , 'MERGE_WEIGHT': >, 'MERGE_DEFAULT': None, '__module__': 'BTrees.OOBTree', '__doc__': None, '_mapping_type': , '_set_type': , '_bucket_type': , '_BTree_reduce_as': , '_BTree_reduce_up_bound': , '__implemented__': classImplements(OOBucket, IMinimalDictionary), '__provides__': directlyProvides(OOBucket), 'foo': 1}) src/BTrees/tests/common.py:150: AssertionError _____ TestAutoOOSetExtendedSetTests.testCannotSetArbitraryAttributeOnBase ______ self = @skipOnPurePython def testCannotSetArbitraryAttributeOnBase(self): if 'Py' in self._getTargetClass().__name__: # pure-python classes can have arbitrary attributes self.skipTest("Not on Pure Python.") > with self.assertRaises(TypeError): E AssertionError: TypeError not raised src/BTrees/tests/common.py:157: AssertionError _________________ TestAutoOOSetExtendedSetTests.testPurePython _________________ self = def testPurePython(self): import importlib kind = self._getTargetClass() class_name = kind.__name__ module_name = kind.__module__ module = importlib.import_module(module_name) # If we're in pure python mode, our target class module # should not have an '_' in it (fix_pickle changes the name # to remove the 'Py') # If we're in the C extension mode, our target class # module still doesn't have the _ in it, but we should be able to find # a Py class that's different self.assertNotIn('_', module_name) self.assertIs(getattr(module, class_name), kind) if not _c_optimizations_ignored() and 'Py' not in type(self).__name__: > self.assertIsNot(getattr(module, class_name + 'Py'), kind) E AssertionError: unexpectedly identical: src/BTrees/tests/common.py:245: AssertionError ________ TestAutoOOSetExtendedSetTests.testSubclassesCanHaveAttributes _________ self = def testSubclassesCanHaveAttributes(self): # https://github.com/zopefoundation/BTrees/issues/168 class Subclass(self._getTargetClass()): pass Subclass.foo = 1 self.assertIn('foo', Subclass.__dict__) > self.assertNotIn('foo', self._getTargetClass().__dict__) E AssertionError: 'foo' unexpectedly found in mappingproxy({'_to_key': , '_to_value': , 'MERGE': , 'MERGE_WEIGHT': >, 'MERGE_DEFAULT': None, '__module__': 'BTrees.OOBTree', '__doc__': None, '_mapping_type': , '_set_type': , '_bucket_type': , '_BTree_reduce_as': , '_BTree_reduce_up_bound': , '__implemented__': classImplements(OOSet, ISet), '__provides__': directlyProvides(OOSet), 'foo': 1}) src/BTrees/tests/common.py:150: AssertionError ____ TestAutoOOTreeSetNormalSetTests.testCannotSetArbitraryAttributeOnBase _____ self = @skipOnPurePython def testCannotSetArbitraryAttributeOnBase(self): if 'Py' in self._getTargetClass().__name__: # pure-python classes can have arbitrary attributes self.skipTest("Not on Pure Python.") > with self.assertRaises(TypeError): E AssertionError: TypeError not raised src/BTrees/tests/common.py:157: AssertionError ________________ TestAutoOOTreeSetNormalSetTests.testPurePython ________________ self = def testPurePython(self): import importlib kind = self._getTargetClass() class_name = kind.__name__ module_name = kind.__module__ module = importlib.import_module(module_name) # If we're in pure python mode, our target class module # should not have an '_' in it (fix_pickle changes the name # to remove the 'Py') # If we're in the C extension mode, our target class # module still doesn't have the _ in it, but we should be able to find # a Py class that's different self.assertNotIn('_', module_name) self.assertIs(getattr(module, class_name), kind) if not _c_optimizations_ignored() and 'Py' not in type(self).__name__: > self.assertIsNot(getattr(module, class_name + 'Py'), kind) E AssertionError: unexpectedly identical: src/BTrees/tests/common.py:245: AssertionError _______ TestAutoOOTreeSetNormalSetTests.testSubclassesCanHaveAttributes ________ self = def testSubclassesCanHaveAttributes(self): # https://github.com/zopefoundation/BTrees/issues/168 class Subclass(self._getTargetClass()): pass Subclass.foo = 1 self.assertIn('foo', Subclass.__dict__) > self.assertNotIn('foo', self._getTargetClass().__dict__) E AssertionError: 'foo' unexpectedly found in mappingproxy({'_to_key': , '_to_value': , 'MERGE': , 'MERGE_WEIGHT': >, 'MERGE_DEFAULT': None, '__module__': 'BTrees.OOBTree', '__doc__': None, '_mapping_type': , '_set_type': , '_bucket_type': , '_BTree_reduce_as': , '_BTree_reduce_up_bound': , '__implemented__': classImplements(OOTreeSet, ITreeSet), '__provides__': directlyProvides(OOTreeSet), 'max_leaf_size': 30, 'max_internal_size': 250, 'foo': 1}) src/BTrees/tests/common.py:150: AssertionError _______ TestAutofsBTreeBTreeTests.testCannotSetArbitraryAttributeOnBase ________ self = @skipOnPurePython def testCannotSetArbitraryAttributeOnBase(self): if 'Py' in self._getTargetClass().__name__: # pure-python classes can have arbitrary attributes self.skipTest("Not on Pure Python.") > with self.assertRaises(TypeError): E AssertionError: TypeError not raised src/BTrees/tests/common.py:157: AssertionError ___________________ TestAutofsBTreeBTreeTests.testPurePython ___________________ self = def testPurePython(self): import importlib kind = self._getTargetClass() class_name = kind.__name__ module_name = kind.__module__ module = importlib.import_module(module_name) # If we're in pure python mode, our target class module # should not have an '_' in it (fix_pickle changes the name # to remove the 'Py') # If we're in the C extension mode, our target class # module still doesn't have the _ in it, but we should be able to find # a Py class that's different self.assertNotIn('_', module_name) self.assertIs(getattr(module, class_name), kind) if not _c_optimizations_ignored() and 'Py' not in type(self).__name__: > self.assertIsNot(getattr(module, class_name + 'Py'), kind) E AssertionError: unexpectedly identical: src/BTrees/tests/common.py:245: AssertionError __________ TestAutofsBTreeBTreeTests.testSubclassesCanHaveAttributes ___________ self = def testSubclassesCanHaveAttributes(self): # https://github.com/zopefoundation/BTrees/issues/168 class Subclass(self._getTargetClass()): pass Subclass.foo = 1 self.assertIn('foo', Subclass.__dict__) > self.assertNotIn('foo', self._getTargetClass().__dict__) E AssertionError: 'foo' unexpectedly found in mappingproxy({'_to_key': , '_to_value': , 'MERGE': , 'MERGE_WEIGHT': >, 'MERGE_DEFAULT': None, '__module__': 'BTrees.fsBTree', '__doc__': None, '_mapping_type': , '_set_type': , '_bucket_type': , '_BTree_reduce_as': , '_BTree_reduce_up_bound': , '__implemented__': classImplements(fsBTree, IBTree), '__provides__': directlyProvides(fsBTree), 'max_leaf_size': 500, 'max_internal_size': 500, 'foo': 1}) src/BTrees/tests/common.py:150: AssertionError ______ TestAutofsBucketMappingBase.testCannotSetArbitraryAttributeOnBase _______ self = @skipOnPurePython def testCannotSetArbitraryAttributeOnBase(self): if 'Py' in self._getTargetClass().__name__: # pure-python classes can have arbitrary attributes self.skipTest("Not on Pure Python.") > with self.assertRaises(TypeError): E AssertionError: TypeError not raised src/BTrees/tests/common.py:157: AssertionError __________________ TestAutofsBucketMappingBase.testPurePython __________________ self = def testPurePython(self): import importlib kind = self._getTargetClass() class_name = kind.__name__ module_name = kind.__module__ module = importlib.import_module(module_name) # If we're in pure python mode, our target class module # should not have an '_' in it (fix_pickle changes the name # to remove the 'Py') # If we're in the C extension mode, our target class # module still doesn't have the _ in it, but we should be able to find # a Py class that's different self.assertNotIn('_', module_name) self.assertIs(getattr(module, class_name), kind) if not _c_optimizations_ignored() and 'Py' not in type(self).__name__: > self.assertIsNot(getattr(module, class_name + 'Py'), kind) E AssertionError: unexpectedly identical: src/BTrees/tests/common.py:245: AssertionError _________ TestAutofsBucketMappingBase.testSubclassesCanHaveAttributes __________ self = def testSubclassesCanHaveAttributes(self): # https://github.com/zopefoundation/BTrees/issues/168 class Subclass(self._getTargetClass()): pass Subclass.foo = 1 self.assertIn('foo', Subclass.__dict__) > self.assertNotIn('foo', self._getTargetClass().__dict__) E AssertionError: 'foo' unexpectedly found in mappingproxy({'_to_key': , '_to_value': , 'MERGE': , 'MERGE_WEIGHT': >, 'MERGE_DEFAULT': None, '__module__': 'BTrees.fsBTree', '__doc__': None, 'toString': .toString at 0x7ff1632701f0>, 'fromString': .fromString at 0x7ff163270280>, '_mapping_type': , '_set_type': , '_bucket_type': , '_BTree_reduce_as': , '_BTree_reduce_up_bound': , '__implemented__': classImplements(fsBucket, IMinimalDictionary), '__provides__': directlyProvides(fsBucket), 'foo': 1}) src/BTrees/tests/common.py:150: AssertionError _____ TestAutofsSetExtendedSetTests.testCannotSetArbitraryAttributeOnBase ______ self = @skipOnPurePython def testCannotSetArbitraryAttributeOnBase(self): if 'Py' in self._getTargetClass().__name__: # pure-python classes can have arbitrary attributes self.skipTest("Not on Pure Python.") > with self.assertRaises(TypeError): E AssertionError: TypeError not raised src/BTrees/tests/common.py:157: AssertionError _________________ TestAutofsSetExtendedSetTests.testPurePython _________________ self = def testPurePython(self): import importlib kind = self._getTargetClass() class_name = kind.__name__ module_name = kind.__module__ module = importlib.import_module(module_name) # If we're in pure python mode, our target class module # should not have an '_' in it (fix_pickle changes the name # to remove the 'Py') # If we're in the C extension mode, our target class # module still doesn't have the _ in it, but we should be able to find # a Py class that's different self.assertNotIn('_', module_name) self.assertIs(getattr(module, class_name), kind) if not _c_optimizations_ignored() and 'Py' not in type(self).__name__: > self.assertIsNot(getattr(module, class_name + 'Py'), kind) E AssertionError: unexpectedly identical: src/BTrees/tests/common.py:245: AssertionError ________ TestAutofsSetExtendedSetTests.testSubclassesCanHaveAttributes _________ self = def testSubclassesCanHaveAttributes(self): # https://github.com/zopefoundation/BTrees/issues/168 class Subclass(self._getTargetClass()): pass Subclass.foo = 1 self.assertIn('foo', Subclass.__dict__) > self.assertNotIn('foo', self._getTargetClass().__dict__) E AssertionError: 'foo' unexpectedly found in mappingproxy({'_to_key': , '_to_value': , 'MERGE': , 'MERGE_WEIGHT': >, 'MERGE_DEFAULT': None, '__module__': 'BTrees.fsBTree', '__doc__': None, '_mapping_type': , '_set_type': , '_bucket_type': , '_BTree_reduce_as': , '_BTree_reduce_up_bound': , '__implemented__': classImplements(fsSet, ISet), '__provides__': directlyProvides(fsSet), 'foo': 1}) src/BTrees/tests/common.py:150: AssertionError ____ TestAutofsTreeSetNormalSetTests.testCannotSetArbitraryAttributeOnBase _____ self = @skipOnPurePython def testCannotSetArbitraryAttributeOnBase(self): if 'Py' in self._getTargetClass().__name__: # pure-python classes can have arbitrary attributes self.skipTest("Not on Pure Python.") > with self.assertRaises(TypeError): E AssertionError: TypeError not raised src/BTrees/tests/common.py:157: AssertionError ________________ TestAutofsTreeSetNormalSetTests.testPurePython ________________ self = def testPurePython(self): import importlib kind = self._getTargetClass() class_name = kind.__name__ module_name = kind.__module__ module = importlib.import_module(module_name) # If we're in pure python mode, our target class module # should not have an '_' in it (fix_pickle changes the name # to remove the 'Py') # If we're in the C extension mode, our target class # module still doesn't have the _ in it, but we should be able to find # a Py class that's different self.assertNotIn('_', module_name) self.assertIs(getattr(module, class_name), kind) if not _c_optimizations_ignored() and 'Py' not in type(self).__name__: > self.assertIsNot(getattr(module, class_name + 'Py'), kind) E AssertionError: unexpectedly identical: src/BTrees/tests/common.py:245: AssertionError _______ TestAutofsTreeSetNormalSetTests.testSubclassesCanHaveAttributes ________ self = def testSubclassesCanHaveAttributes(self): # https://github.com/zopefoundation/BTrees/issues/168 class Subclass(self._getTargetClass()): pass Subclass.foo = 1 self.assertIn('foo', Subclass.__dict__) > self.assertNotIn('foo', self._getTargetClass().__dict__) E AssertionError: 'foo' unexpectedly found in mappingproxy({'_to_key': , '_to_value': , 'MERGE': , 'MERGE_WEIGHT': >, 'MERGE_DEFAULT': None, '__module__': 'BTrees.fsBTree', '__doc__': None, '_mapping_type': , '_set_type': , '_bucket_type': , '_BTree_reduce_as': , '_BTree_reduce_up_bound': , '__implemented__': classImplements(fsTreeSet, ITreeSet), '__provides__': directlyProvides(fsTreeSet), 'max_leaf_size': 500, 'max_internal_size': 500, 'foo': 1}) src/BTrees/tests/common.py:150: AssertionError =============================== warnings summary =============================== src/BTrees/tests/test_dynamic_btrees.py::test_suite /usr/lib/python3.10/site-packages/_pytest/python.py:166: PytestReturnNotNoneWarning: Expected None, but src/BTrees/tests/test_dynamic_btrees.py::test_suite returned , , , [......] ]>]>]>, which will be an error in a future version of pytest. Did you mean to use `assert` instead of `return`? warnings.warn( -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== short test summary info ============================ SKIPPED [2] src/BTrees/tests/common.py:2482: ZODB not available SKIPPED [2] src/BTrees/tests/common.py:1411: ZODB not available SKIPPED [4] src/BTrees/tests/common.py:1353: ZODB not available SKIPPED [8] src/BTrees/tests/common.py:275: ZODB not available SKIPPED [4] src/BTrees/tests/common.py:1279: Needs bounded key and value SKIPPED [8] src/BTrees/tests/common.py:247: ZODB not available SKIPPED [8] src/BTrees/tests/common.py:337: ZODB not available SKIPPED [2] src/BTrees/tests/common.py:3389: Needs ported to fsBTree SKIPPED [2] src/BTrees/tests/common.py:3404: Needs ported to fsBTree SKIPPED [2] src/BTrees/tests/common.py:3442: Needs ported to fsBTree SKIPPED [2] src/BTrees/tests/common.py:3460: Uses keys too large for fsBTree SKIPPED [2] src/BTrees/tests/common.py:3396: Needs ported to fsBTree SKIPPED [2] src/BTrees/tests/common.py:3351: Needs ported to fsBTree SKIPPED [2] src/BTrees/tests/common.py:3363: Needs ported to fsBTree SKIPPED [2] src/BTrees/tests/common.py:3452: Needs ported to fsBTree SKIPPED [2] src/BTrees/tests/common.py:3411: Uses keys too large for fsBTree SKIPPED [2] src/BTrees/tests/common.py:3427: Needs ported to fsBTree SKIPPED [2] src/BTrees/tests/common.py:3376: Needs ported to fsBTree SKIPPED [2] src/BTrees/tests/common.py:1263: Key to big SKIPPED [2] src/BTrees/tests/common.py:744: Needs negative keys and values SKIPPED [1] src/BTrees/tests/common.py:1754: XXX: Needs ported for fsBTree SKIPPED [2] src/BTrees/tests/common.py:3573: Uses keys too large for fsBTree SKIPPED [2] src/BTrees/tests/common.py:3524: Uses keys too large for fsBTree FAILED src/BTrees/tests/test_OOBTree.py::TestAutoOOBTreeOOBTreeTest::testCannotSetArbitraryAttributeOnBase FAILED src/BTrees/tests/test_OOBTree.py::TestAutoOOBTreeOOBTreeTest::testPurePython FAILED src/BTrees/tests/test_OOBTree.py::TestAutoOOBTreeOOBTreeTest::testSubclassesCanHaveAttributes FAILED src/BTrees/tests/test_OOBTree.py::TestAutoOOBucketMappingBase::testCannotSetArbitraryAttributeOnBase FAILED src/BTrees/tests/test_OOBTree.py::TestAutoOOBucketMappingBase::testPurePython FAILED src/BTrees/tests/test_OOBTree.py::TestAutoOOBucketMappingBase::testSubclassesCanHaveAttributes FAILED src/BTrees/tests/test_OOBTree.py::TestAutoOOSetExtendedSetTests::testCannotSetArbitraryAttributeOnBase FAILED src/BTrees/tests/test_OOBTree.py::TestAutoOOSetExtendedSetTests::testPurePython FAILED src/BTrees/tests/test_OOBTree.py::TestAutoOOSetExtendedSetTests::testSubclassesCanHaveAttributes FAILED src/BTrees/tests/test_OOBTree.py::TestAutoOOTreeSetNormalSetTests::testCannotSetArbitraryAttributeOnBase FAILED src/BTrees/tests/test_OOBTree.py::TestAutoOOTreeSetNormalSetTests::testPurePython FAILED src/BTrees/tests/test_OOBTree.py::TestAutoOOTreeSetNormalSetTests::testSubclassesCanHaveAttributes FAILED src/BTrees/tests/test_fsBTree.py::TestAutofsBTreeBTreeTests::testCannotSetArbitraryAttributeOnBase FAILED src/BTrees/tests/test_fsBTree.py::TestAutofsBTreeBTreeTests::testPurePython FAILED src/BTrees/tests/test_fsBTree.py::TestAutofsBTreeBTreeTests::testSubclassesCanHaveAttributes FAILED src/BTrees/tests/test_fsBTree.py::TestAutofsBucketMappingBase::testCannotSetArbitraryAttributeOnBase FAILED src/BTrees/tests/test_fsBTree.py::TestAutofsBucketMappingBase::testPurePython FAILED src/BTrees/tests/test_fsBTree.py::TestAutofsBucketMappingBase::testSubclassesCanHaveAttributes FAILED src/BTrees/tests/test_fsBTree.py::TestAutofsSetExtendedSetTests::testCannotSetArbitraryAttributeOnBase FAILED src/BTrees/tests/test_fsBTree.py::TestAutofsSetExtendedSetTests::testPurePython FAILED src/BTrees/tests/test_fsBTree.py::TestAutofsSetExtendedSetTests::testSubclassesCanHaveAttributes FAILED src/BTrees/tests/test_fsBTree.py::TestAutofsTreeSetNormalSetTests::testCannotSetArbitraryAttributeOnBase FAILED src/BTrees/tests/test_fsBTree.py::TestAutofsTreeSetNormalSetTests::testPurePython FAILED src/BTrees/tests/test_fsBTree.py::TestAutofsTreeSetNormalSetTests::testSubclassesCanHaveAttributes ============ 24 failed, 951 passed, 67 skipped, 1 warning in 9.26s ============= ```
kloczek commented 3 months ago

Just tested 6.0 and I still see those fails. In mean time to be able test BTrees with "test as installed" methodology typically used on packaging I made patch which removes all relative imports. Would you accept as PR below patch?

```patch --- b/src/BTrees/__init__.py +++ a/src/BTrees/__init__.py @@ -18,7 +18,7 @@ import BTrees.Interfaces -from ._module_builder import create_module +from BTrees._module_builder import create_module __all__ = [ --- b/src/BTrees/_base.py +++ a/src/BTrees/_base.py @@ -16,8 +16,8 @@ from persistent import Persistent -from ._compat import compare -from .Interfaces import BTreesConflictError +from BTrees._compat import compare +from BTrees.Interfaces import BTreesConflictError _marker = object() --- b/src/BTrees/_datatypes.py +++ a/src/BTrees/_datatypes.py @@ -19,7 +19,7 @@ import operator import struct -from .utils import Lazy +from BTrees.utils import Lazy class DataType: --- b/src/BTrees/_module_builder.py +++ a/src/BTrees/_module_builder.py @@ -24,13 +24,13 @@ def _create_classes( module_name, key_datatype, value_datatype, ): - from ._base import MERGE # Won't always want this. - from ._base import Bucket - from ._base import Set - from ._base import Tree - from ._base import TreeSet - from ._base import _TreeItems as TreeItems - from ._base import _TreeIterator + from BTrees._base import MERGE # Won't always want this. + from BTrees._base import Bucket + from BTrees._base import Set + from BTrees._base import Tree + from BTrees._base import TreeSet + from BTrees._base import _TreeItems as TreeItems + from BTrees._base import _TreeIterator classes = {} @@ -85,13 +85,13 @@ def _create_set_operations(module_name, key_type, value_type, set_type): - from ._base import difference - from ._base import intersection - from ._base import multiunion - from ._base import set_operation - from ._base import union - from ._base import weightedIntersection - from ._base import weightedUnion + from BTrees._base import difference + from BTrees._base import intersection + from BTrees._base import multiunion + from BTrees._base import set_operation + from BTrees._base import union + from BTrees._base import weightedIntersection + from BTrees._base import weightedUnion ops = { op.__name__ + 'Py': set_operation(op, set_type) @@ -133,9 +133,9 @@ interface, module=None): import collections.abc - from . import Interfaces as interfaces - from ._base import _fix_pickle - from ._compat import import_c_extension + from BTrees import Interfaces as interfaces + from BTrees._base import _fix_pickle + from BTrees._compat import import_c_extension module_name = mod_globals['__name__'] # Define the Python implementations @@ -214,8 +214,8 @@ def create_module(prefix): import types - from . import Interfaces - from . import _datatypes as datatypes + from BTrees import Interfaces + from BTrees import _datatypes as datatypes mod = types.ModuleType('BTrees.' + prefix + 'BTree') --- b/src/BTrees/tests/_test_builder.py +++ a/src/BTrees/tests/_test_builder.py @@ -14,23 +14,23 @@ import unittest -from .common import BTreeTests -from .common import ExtendedSetTests -from .common import I_SetsBase -from .common import InternalKeysMappingTest -from .common import MappingBase -from .common import MappingConflictTestBase -from .common import ModuleTest -from .common import MultiUnion -from .common import NormalSetTests -from .common import SetConflictTestBase -from .common import SetResult -from .common import TestLongIntKeys -from .common import TestLongIntValues -from .common import Weighted -from .common import itemsToSet -from .common import makeMapBuilder -from .common import makeSetBuilder +from BTrees.tests.common import BTreeTests +from BTrees.tests.common import ExtendedSetTests +from BTrees.tests.common import I_SetsBase +from BTrees.tests.common import InternalKeysMappingTest +from BTrees.tests.common import MappingBase +from BTrees.tests.common import MappingConflictTestBase +from BTrees.tests.common import ModuleTest +from BTrees.tests.common import MultiUnion +from BTrees.tests.common import NormalSetTests +from BTrees.tests.common import SetConflictTestBase +from BTrees.tests.common import SetResult +from BTrees.tests.common import TestLongIntKeys +from BTrees.tests.common import TestLongIntValues +from BTrees.tests.common import Weighted +from BTrees.tests.common import itemsToSet +from BTrees.tests.common import makeMapBuilder +from BTrees.tests.common import makeSetBuilder class _FilteredModuleProxy: --- b/src/BTrees/tests/testConflict.py +++ a/src/BTrees/tests/testConflict.py @@ -13,8 +13,8 @@ ############################################################################## import unittest -from .common import ConflictTestBase -from .common import _skip_wo_ZODB +from BTrees.tests.common import ConflictTestBase +from BTrees.tests.common import _skip_wo_ZODB class NastyConfictFunctionalTests(ConflictTestBase, unittest.TestCase): --- b/src/BTrees/tests/testPersistency.py +++ a/src/BTrees/tests/testPersistency.py @@ -14,9 +14,9 @@ from unittest import TestCase -from ..OOBTree import OOBTree -from .common import ZODBAccess -from .common import _skip_wo_ZODB +from BTrees.OOBTree import OOBTree +from BTrees.tests.common import ZODBAccess +from BTrees.tests.common import _skip_wo_ZODB BUCKET_SIZE = OOBTree.max_leaf_size --- b/src/BTrees/tests/test_OOBTree.py +++ a/src/BTrees/tests/test_OOBTree.py @@ -13,8 +13,8 @@ ############################################################################## from BTrees import OOBTree -from ._test_builder import update_module -from .common import BTreeTests +from BTrees.tests._test_builder import update_module +from BTrees.tests.common import BTreeTests class OOBTreeTest(BTreeTests): --- b/src/BTrees/tests/test__base.py +++ a/src/BTrees/tests/test__base.py @@ -25,7 +25,7 @@ class Test_Base(unittest.TestCase): def _getTargetClass(self): - from .._base import _Base + from BTrees._base import _Base return _Base def _makeOne(self, items=None): @@ -54,7 +54,7 @@ class Test_BucketBase(unittest.TestCase): def _getTargetClass(self): - from .._base import _BucketBase + from BTrees._base import _BucketBase return _BucketBase def _makeOne(self, *args, **kw): @@ -397,14 +397,14 @@ assertRaises = _assertRaises def _getTargetClass(self): - from .._base import _SetIteration + from BTrees._base import _SetIteration return _SetIteration def _makeOne(self, to_iterate, useValues=False, default=None): return self._getTargetClass()(to_iterate, useValues, default) def test_ctor_w_None(self): - from .._base import _marker + from BTrees._base import _marker si = self._makeOne(None) self.assertEqual(si.useValues, False) self.assertTrue(si.key is _marker) @@ -426,11 +426,11 @@ assertRaises = _assertRaises def _getTargetClass(self): - from .._base import Bucket + from BTrees._base import Bucket return Bucket def _makeOne(self): - from .._datatypes import O + from BTrees._datatypes import O class _Bucket(self._getTargetClass()): _to_key = O() @@ -805,7 +805,7 @@ self.assertTrue(bucket._next is next_b) def test__p_resolveConflict_x_on_com_next_old_new_None(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError bucket = self._makeOne() N_NEW = object() s_old = None @@ -816,7 +816,7 @@ self.assertEqual(e.reason, 0) def test__p_resolveConflict_x_on_com_next(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError bucket = self._makeOne() N_NEW = object() s_old = ((), None) @@ -827,7 +827,7 @@ self.assertEqual(e.reason, 0) def test__p_resolveConflict_x_on_new_next_old_com_None(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError bucket = self._makeOne() N_NEW = object() s_old = None @@ -838,7 +838,7 @@ self.assertEqual(e.reason, 0) def test__p_resolveConflict_x_on_new_next(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError bucket = self._makeOne() N_NEW = object() s_old = ((), None) @@ -849,7 +849,7 @@ self.assertEqual(e.reason, 0) def test__p_resolveConflict_x_on_com_empty(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError bucket = self._makeOne() s_old = (('a', 'b', 'c', 'd'), None) s_com = ((), None) @@ -859,7 +859,7 @@ self.assertEqual(e.reason, 12) def test__p_resolveConflict_x_on_new_empty(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError bucket = self._makeOne() s_old = (('a', 0, 'b', 1), None) s_com = (('a', 0), None) @@ -869,7 +869,7 @@ self.assertEqual(e.reason, 12) def test__p_resolveConflict_x_both_update_same_key(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError bucket = self._makeOne() s_old = (('a', 0), None) s_com = (('a', 5, 'b', 1, 'c', 2), None) @@ -879,7 +879,7 @@ self.assertEqual(e.reason, 1) def test__p_resolveConflict_x_on_del_first_com_x(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError bucket = self._makeOne() s_old = (('a', 0, 'b', 1, 'c', 2), None) s_com = (('b', 1), None) @@ -889,7 +889,7 @@ self.assertEqual(e.reason, 13) def test__p_resolveConflict_x_on_del_first_new_x(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError bucket = self._makeOne() s_old = (('a', 0, 'b', 1, 'c', 2), None) s_com = (('a', 0, 'b', 1), None) @@ -899,7 +899,7 @@ self.assertEqual(e.reason, 13) def test__p_resolveConflict_x_on_del_first_new(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError bucket = self._makeOne() s_old = (('a', 0, 'b', 1), None) s_com = (('a', 1, 'b', 2, 'c', 3), None) @@ -909,7 +909,7 @@ self.assertEqual(e.reason, 2) def test__p_resolveConflict_x_on_del_first_com(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError bucket = self._makeOne() s_old = (('a', 0, 'b', 1), None) s_com = (('b', 4), None) @@ -919,7 +919,7 @@ self.assertEqual(e.reason, 3) def test__p_resolveConflict_x_on_ins_same_after_del(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError bucket = self._makeOne() s_old = (('a', 0, 'b', 1), None) s_com = (('a', 0, 'c', 2), None) @@ -929,7 +929,7 @@ self.assertEqual(e.reason, 4) def test__p_resolveConflict_x_on_del_same(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError bucket = self._makeOne() s_old = (('a', 0, 'b', 1, 'c', 2), None) s_com = (('a', 0, 'c', 2), None) @@ -939,7 +939,7 @@ self.assertEqual(e.reason, 5) def test__p_resolveConflict_x_on_append_same(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError bucket = self._makeOne() s_old = (('a', 0, ), None) s_com = (('a', 0, 'b', 1), None) @@ -949,7 +949,7 @@ self.assertEqual(e.reason, 6) def test__p_resolveConflict_x_on_new_deletes_all_com_adds(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError bucket = self._makeOne() s_old = (('a', 0, 'b', 1, 'c', 2), None) s_com = (('a', 0, 'd', 3, 'e', 4, 'f', 5), None) @@ -959,7 +959,7 @@ self.assertEqual(e.reason, 7) def test__p_resolveConflict_x_on_com_deletes_all_new_adds(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError bucket = self._makeOne() s_old = (('a', 0, 'b', 1, 'c', 2), None) s_com = (('a', 0, ), None) @@ -969,7 +969,7 @@ self.assertEqual(e.reason, 8) def test__p_resolveConflict_x_on_com_deletes_all_new_deletes(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError bucket = self._makeOne() s_old = (('a', 0, 'b', 1, 'c', 2), None) s_com = (('a', 0, ), None) @@ -1088,7 +1088,7 @@ assertRaises = _assertRaises def _getTargetClass(self): - from .._base import Set + from BTrees._base import Set return Set def _makeOne(self): @@ -1227,7 +1227,7 @@ self.assertTrue(new_b._next is next_b) def test__p_resolveConflict_x_on_com_next_old_new_None(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError _set = self._makeOne() N_NEW = object() s_old = None @@ -1238,7 +1238,7 @@ self.assertEqual(e.reason, 0) def test__p_resolveConflict_x_on_com_next(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError _set = self._makeOne() N_NEW = object() s_old = ((), None) @@ -1249,7 +1249,7 @@ self.assertEqual(e.reason, 0) def test__p_resolveConflict_x_on_new_next_old_com_None(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError _set = self._makeOne() N_NEW = object() s_old = None @@ -1260,7 +1260,7 @@ self.assertEqual(e.reason, 0) def test__p_resolveConflict_x_on_new_next(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError _set = self._makeOne() N_NEW = object() s_old = ((), None) @@ -1271,7 +1271,7 @@ self.assertEqual(e.reason, 0) def test__p_resolveConflict_x_on_com_empty(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError _set = self._makeOne() s_old = (('a', 'b'), None) s_com = ((), None) @@ -1281,7 +1281,7 @@ self.assertEqual(e.reason, 12) def test__p_resolveConflict_x_on_new_empty(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError _set = self._makeOne() s_old = (('a', 'b'), None) s_com = (('a',), None) @@ -1291,7 +1291,7 @@ self.assertEqual(e.reason, 12) def test__p_resolveConflict_x_on_del_first_com(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError _set = self._makeOne() s_old = (('a', 'b'), None) s_com = (('b',), None) @@ -1301,7 +1301,7 @@ self.assertEqual(e.reason, 13) def test__p_resolveConflict_x_on_del_first_new(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError _set = self._makeOne() s_old = (('a', 'b'), None) s_com = (('a', 'b', 'c'), None) @@ -1311,7 +1311,7 @@ self.assertEqual(e.reason, 13) def test__p_resolveConflict_x_on_ins_same_after_del(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError _set = self._makeOne() s_old = (('a', 'b'), None) s_com = (('a', 'c'), None) @@ -1321,7 +1321,7 @@ self.assertEqual(e.reason, 4) def test__p_resolveConflict_x_on_del_same(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError _set = self._makeOne() s_old = (('a', 'b', 'c'), None) s_com = (('a', 'c'), None) @@ -1331,7 +1331,7 @@ self.assertEqual(e.reason, 5) def test__p_resolveConflict_x_on_append_same(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError _set = self._makeOne() s_old = (('a',), None) s_com = (('a', 'b'), None) @@ -1341,7 +1341,7 @@ self.assertEqual(e.reason, 6) def test__p_resolveConflict_x_on_new_deletes_all_com_adds(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError _set = self._makeOne() s_old = (('a', 'b', 'c'), None) s_com = (('a', 'd', 'e', 'f'), None) @@ -1351,7 +1351,7 @@ self.assertEqual(e.reason, 7) def test__p_resolveConflict_x_on_com_deletes_all_new_adds(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError _set = self._makeOne() s_old = (('a', 'b', 'c'), None) s_com = (('a',), None) @@ -1361,7 +1361,7 @@ self.assertEqual(e.reason, 8) def test__p_resolveConflict_x_on_com_deletes_all_new_deletes(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError _set = self._makeOne() s_old = (('a', 'b', 'c'), None) s_com = (('a',), None) @@ -1471,7 +1471,7 @@ class Test_TreeItem(unittest.TestCase): def _getTargetClass(self): - from .._base import _TreeItem + from BTrees._base import _TreeItem return _TreeItem def _makeOne(self, key, child): @@ -1489,13 +1489,13 @@ assertRaises = _assertRaises def _getTargetClass(self): - from .._base import _Tree + from BTrees._base import _Tree return _Tree def _makeOne(self, items=None, bucket_type=None): - from .._base import Bucket - from .._datatypes import Any - from .._datatypes import O + from BTrees._base import Bucket + from BTrees._datatypes import Any + from BTrees._datatypes import O if bucket_type is None: class _Bucket(Bucket): @@ -2042,7 +2042,7 @@ self.assertTrue(tree._firstbucket._p_oid is None) def test___setstate___to_multiple_buckets(self): - from .._base import Bucket + from BTrees._base import Bucket class _Bucket(Bucket): @@ -2153,7 +2153,7 @@ EMPTY, DEGEN, INVALID) def test__p_resolveConflict_non_degenerate_state(self): - from ..Interfaces import BTreesConflictError + from BTrees.Interfaces import BTreesConflictError tree = self._makeOne() FIRST = object() NON_DEGEN = ((FIRST, 'a', object(), 'b', object()), FIRST) @@ -2243,14 +2243,14 @@ assertRaises = _assertRaises def _getTargetClass(self): - from .._base import _TreeItems + from BTrees._base import _TreeItems return _TreeItems def _makeOne(self, firstbucket, itertype, iterargs): return self._getTargetClass()(firstbucket, itertype, iterargs) def _makeBucket(self, items=None): - from .._base import Bucket + from BTrees._base import Bucket class _Bucket(Bucket): @@ -2330,11 +2330,11 @@ assertRaises = _assertRaises def _getTargetClass(self): - from .._base import Tree + from BTrees._base import Tree return Tree def _makeOne(self, items=None): - from .._base import Bucket + from BTrees._base import Bucket class _Bucket(Bucket): @@ -2492,11 +2492,11 @@ assertRaises = _assertRaises def _getTargetClass(self): - from .._base import TreeSet + from BTrees._base import TreeSet return TreeSet def _makeOne(self, items=None): - from .._base import Bucket + from BTrees._base import Bucket class _Bucket(Bucket): def _to_key(self, k): @@ -2558,7 +2558,7 @@ assertRaises = _assertRaises def _getTargetClass(self): - from .._base import set_operation + from BTrees._base import set_operation return set_operation def _makeOne(self, func, set_type): @@ -2591,7 +2591,7 @@ class Test_difference(unittest.TestCase, _SetObBase): def _callFUT(self, *args, **kw): - from .._base import difference + from BTrees._base import difference return difference(*args, **kw) def test_lhs_none(self): @@ -2649,7 +2649,7 @@ class Test_union(unittest.TestCase, _SetObBase): def _callFUT(self, *args, **kw): - from .._base import union + from BTrees._base import union return union(*args, **kw) def test_lhs_none(self): @@ -2701,7 +2701,7 @@ class Test_intersection(unittest.TestCase, _SetObBase): def _callFUT(self, *args, **kw): - from .._base import intersection + from BTrees._base import intersection return intersection(*args, **kw) def test_lhs_none(self): @@ -2753,7 +2753,7 @@ class Test_weightedUnion(unittest.TestCase, _SetObBase): def _callFUT(self, *args, **kw): - from .._base import weightedUnion + from BTrees._base import weightedUnion return weightedUnion(*args, **kw) def test_both_none(self): @@ -2882,7 +2882,7 @@ class Test_weightedIntersection(unittest.TestCase, _SetObBase): def _callFUT(self, *args, **kw): - from .._base import weightedIntersection + from BTrees._base import weightedIntersection return weightedIntersection(*args, **kw) def test_both_none(self): @@ -2970,7 +2970,7 @@ class Test_multiunion(unittest.TestCase, _SetObBase): def _callFUT(self, *args, **kw): - from .._base import multiunion + from BTrees._base import multiunion return multiunion(*args, **kw) def test_no_seqs(self): --- b/src/BTrees/tests/test_dynamic_btrees.py +++ a/src/BTrees/tests/test_dynamic_btrees.py @@ -20,7 +20,7 @@ from BTrees import _FAMILIES -from ._test_builder import update_module +from BTrees.tests._test_builder import update_module # If there is no .py file on disk, create the module in memory. --- b/src/BTrees/tests/test_fsBTree.py +++ a/src/BTrees/tests/test_fsBTree.py @@ -15,7 +15,7 @@ from BTrees import fsBTree -from ._test_builder import update_module +from BTrees.tests._test_builder import update_module class fsBucketTests(unittest.TestCase): @@ -27,7 +27,7 @@ return self._getTargetClass()(*args, **kw) def _makeBytesItems(self): - from .._compat import _ascii + from BTrees._compat import _ascii return [(_ascii(c*2), _ascii(c*6)) for c in 'abcdef'] def test_toString(self): ```
icemac commented 3 months ago

If the tests do not fail with these changes I'd accept the PR.

kloczek commented 3 months ago

If the tests do not fail with these changes I'd accept the PR.

With that patch it is possible at all test your module because without it is not possible to pass scanning units.

icemac commented 3 months ago

Please keep in mind: The tests have to succeed with zope.testrunner. If your planned changes help for pytest compatiblity I do not mind.

kloczek commented 3 months ago

I understand that .. however correctly written zope test runner test suite should be correctly handled by pytest which by the way is much more flexible and reach of possible to use features. I'm only flagging some issues in such scenario.

d-maurer commented 3 months ago

Tomasz Kłoczko wrote at 2024-6-5 02:21 -0700:

I understand that .. however correctly written zope test runner test suite should be correctly handled by pytest which by the way is much more flexible and reach of possible to use features.

We already had a discussion like this. When I remember right, you have not yet answered a question in this context: does pytest support "layer"s?

A test can be associated with a "layer". A "layer" is a class with optional setUp and tearDown methods. zope.testrunner executes all tests associated with the same layer in a shared set up built by the "layer"s setUp before the first such test, shared by all those tests and torn down after all those tests by the "layer"s tearDown). "layer"s are organized via the class inheritance, i.e. "layer"s can be nested.

The zopefoundation projects typically make significant use of the "layer" concept in order to reduce the test time. If a test runner does not support it, failures are to be expected.

icemac commented 3 months ago

pytest does not support layers. There is zope.pytestlayer which – as a plug-in – adds layer support; but it has its own problems. There are currently more important maintainance tasks on my list. The test runner is one of the least problems I currently have.

kloczek commented 3 months ago

https://github.com/pytest-dev/pytest/discussions/12423#discussioncomment-9678819