Fix NameError in run-tests.py

There is a potential NameError in `run-tests.py`, it should be fixed now.