Fixed python3 ResourceWarning in test.py