etetoolkit / ete

Python package for building, comparing, annotating, manipulating and visualising trees. It provides a comprehensive API and a collection of command line tools, including utilities to work with the NCBI taxonomy tree.
http://etetoolkit.org
GNU General Public License v3.0
768 stars 216 forks source link

tests/test_evol.py: port assertions to python3.12. #737

Open emollier opened 6 months ago

emollier commented 6 months ago

As first identified in Debian bug #1058334 affecting ete3, since introduction of Python 3.12, a number of tests are failing with errors looking like:

AttributeError: 'Test_Coretype_ArrayTable' object has no attribute 'assert_'. Did you mean: 'assertIn'?

This is because the newer version of the unittest module of the standard library removed the use of deprecated assert function for other ones more meaningful, as documented in Python 3.12 novelties. It appears that there are still a few assert occurrences remaining in ete4 source code, so this patch modernizes them.