Loosen error tolerance in test.
The PROPKA31 tests fail on Windows 10 Ubuntu 18.04 Windows Subsystem Linux without any changes. The relative error is less than 1e-3. This commit chnages the behavior to a test of absolute agreement to a test of relative error less than 1e-3.
This commit is contained in:
@@ -4,6 +4,11 @@ import re
|
||||
from subprocess import call
|
||||
import sys
|
||||
import unittest
|
||||
import logging
|
||||
|
||||
|
||||
ACCEPTABLE_ERROR = 0.001
|
||||
|
||||
|
||||
# Setting this up as a direct translation of the original runtest.py script
|
||||
# that will be run as part of 'python setup.py test'. This takes on the
|
||||
@@ -53,8 +58,10 @@ class SystemTest(unittest.TestCase):
|
||||
|
||||
expected_value = float(ref.readline())
|
||||
value = float(m.group(0))
|
||||
value_error = (value-expected_value)/expected_value
|
||||
|
||||
if(value != expected_value):
|
||||
if abs(value_error) > ACCEPTABLE_ERROR:
|
||||
logging.error(value_error)
|
||||
identity = line[:m.start()].strip()
|
||||
errors.append("%12s %8.2f %8.2f" %
|
||||
(identity, expected_value, value))
|
||||
|
||||
Reference in New Issue
Block a user