Fixes #4657: Reset the globals after running the tests
Merge pull request #361 from rjd22/3.3/bugfix/globals_reset_in_test

Fixes #4657: Reset the globals after running the tests