TRIQS / triqs

a Toolbox for Research on Interacting Quantum Systems
https://triqs.github.io
GNU General Public License v3.0
141 stars 72 forks source link

tests: Improve error messages and fix failure with GCC 10 #800

Closed hmenke closed 3 years ago

hmenke commented 3 years ago

Currently the unit tests only use the assertTrue method of the unittest framework. This results in useless error messages à la False is not true in the case of a test failure. By using the provided assertion methods these messages can be improved substantially.

This came up because I compiled TRIQS with GCC 10 (in GitHub Actions) and ran the tests where the test py_tail_issues failed repeatedly.

Traceback (most recent call last):
  File "/build/source/test/python/base/tail_issues.py", line 137, in test_delta_infty
    self.assertLess(max_im, 1e-12)
AssertionError: 1.8302364448227348e-12 not less than 1e-12

To this end I propose increasing the test tolerance from 1e-12 to 2e-12.

Wentzell commented 3 years ago

Looks good! Thank you @hmenke