GeoscienceAustralia / tcrm

A statistical-parametric model for assessing wind hazard from tropical cyclones
http://geoscienceaustralia.github.io/tcrm
Other
81 stars 52 forks source link

Test failing NoSectionError #61

Closed benjimin closed 5 years ago

benjimin commented 5 years ago

python tests/run.py

======================================================================
ERROR: test_readCSV (tests.test_columns.TestReadCSV)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/g/data1a/w85/brl654/tcrm/tests/test_columns.py", line 33, in test_readCSV
    loadedData = columns.colReadCSV(self.configFile, self.inputFile, self.source)
  File "/g/data1a/w85/brl654/tcrm/Utilities/columns.py", line 34, in colReadCSV
    delimiter = config.get(source, 'FieldDelimiter')
  File "/g/data/w85/brl654/conda/envs/tcrm/lib/python2.7/ConfigParser.py", line 330, in get
    raise NoSectionError(section)
NoSectionError: No section: 'TEST'

python tests/test_columns.py

OK
benjimin commented 5 years ago

Looks like the configparser subclass recognises that a config file has already been read (by a previous test) and so, in a broken attempt to prevent unnecessarily parsing "the" file repeatedly, silently declines to parse any further files.

(This bug relates to the use of singleton-pattern and the pervasively-widespread argument-passing of the config-filename. In other words, implicit dependence upon mutable global state. See also issue #68 and #65.)

benjimin commented 5 years ago

Fixed (without attacking broader issues) in commit 53733c1, merged in v2.1.3.