SpiNNakerManchester / SpiNNUtils

Utility classes and functions for SpiNNaker projects
Apache License 2.0
1 stars 5 forks source link

Unittest setup #159

Closed Christian-B closed 3 years ago

Christian-B commented 3 years ago

The steps that tests needed to do before (and after) accessing configs or global variables was getting confusing.

This set of PRs adds a single unittest_Setup method which

  1. Clears out any previously read in configs
  2. Identifies the config file to read in if needed
  3. Clears out any simulator previously set
  4. Puts the global_variables into unittest mode so default values can be provided

Allows the get_config and global_variables methods to raise an exception in neither unittest_setup nor sim.setup() was called.

The error messages are targeted at none unit test usage,

While many test do not actually need unittest_step the choice was to call it from all except.

  1. One that call sim.setup
  2. import all to make sure the import works without
rowleya commented 3 years ago

Everything looks OK. Comments are in:

Those are both minor so happy for this to be merged if the comments are not agreed with, or things changed and then merged.