AdityaSavara / UnitTesterSG

UnitTesterSG is for unit testing scientific/engineering outputs. It accommodates nested and even staggered array type structures, and mixed data types (like strings and integers etc). It also enables you to set numerical and absolute tolerances. Compatible with pytest.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UnitTesterSG should have option to not ask when strings don't match

AdityaSavara opened this issue · comments

By default, UnitTesterSG will always stop if there is a test where the objects converted to strings don't match.

The code should be changed to have an argument where the default is bypassing this, as long as the test has passed.

The way to do this is going to be to put a global variable and extra argument into the function that runs the tests. That way, the global variable can be checked before asking the questions.

The file runUnitTesterSG.py can then take an optional command line argument like "-s" or something like that. (for string)

Note: There is a workaround. For any individual test, set allowOverwrite to False when calling doTest if you want to skip UnitTesterSG from stopping to notify user when results match but strings don't.

This now exists. interactiveTesting=False is the default, and will not stop during the run.