srnas/barnaba

Test failure

Closed this issue · 5 comments

Some tests are failing on my laptop

> ======================================================================
> FAIL: test_dump.test_dump
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/Users/giopina/software/miniconda3/envs/barnaba/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
>     self.test(*self.arg)
>   File "/Users/giopina/software/barnaba/test/test_dump.py", line 36, in test_dump
>     assert(filecmp.cmp("%s/dump_01.test.dat" % outdir,"%s/dump_01.test.dat" % refdir)==True)
> AssertionError
> 
> ======================================================================
> FAIL: test_ermsd.test_ermsd_4
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/Users/giopina/software/miniconda3/envs/barnaba/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
>     self.test(*self.arg)
>   File "/Users/giopina/software/barnaba/test/test_ermsd.py", line 60, in test_ermsd_4
>     assert(filecmp.cmp("%s/ermsd_04.test.dat" % outdir,"%s/ermsd_04.test.dat" % refdir)==True)
> AssertionError
> 
> ----------------------------------------------------------------------
> 

It looks like an approximation error

$diff test/tmp/ermsd_04.test.dat test/reference/ermsd_04.test.dat 
1c1
<   8.687377e-06 
---
>   8.672981e-06 
15c15
<   8.251643e-01 
---
>   8.251644e-01 
91c91
<   9.887980e-01 
---
>   9.887979e-01 

tmp_diff-dump_01.txt

Is it possible to just write less digits? Or maybe better write numbers in fixed format.

Is it possible to just write less digits? Or maybe better write numbers in fixed format.

The problem is that the first differs in the 3rd digit.
I guess that's because it's a very small number.

I have fixed this in the last commit. Try to update and rerun the tests.

Great. Now it's working fine