• Kirill Smelkov's avatar
    amari.kpi: tests: Use %r instead of %s to workaround float-point rounding · a9443060
    Kirill Smelkov authored
    For py3 it does not matter, but on py2 %s prettifies result a bit:
    
        kirr@deca:~$ python
        Python 2.7.18 (default, Jul 14 2021, 08:11:37)
        >>> str(0.1-0.01)
        '0.09'
        >>> repr(0.1-0.01)
        '0.09000000000000001'
    
        kirr@deca:~$ python3
        Python 3.9.2 (default, Feb 28 2021, 17:03:44)
        >>> str(0.1-0.01)
        '0.09000000000000001'
        >>> repr(0.1-0.01)
        '0.09000000000000001'
    
    Should make the diff in between master and py2 a bit smaller.
    a9443060
kpi_test.py 24.9 KB