-import os
-U = os.getenv('USER')
-f=open("/tmp/" + U + "/UnitTestsResult", 'a')
-f.write(" --- TEST src/yacsloader: testEdit.py\n")
-suite = unittest.makeSuite(TestEdit)
-result=unittest.TextTestRunner(f, descriptions=1, verbosity=1).run(suite)
-f.close()
-sys.exit(not result.wasSuccessful())
+if __name__ == '__main__':
+ import os
+ U = os.getenv('USER')
+ with open("/tmp/" + U + "/UnitTestsResult", 'a') as f:
+ f.write(" --- TEST src/yacsloader: testEdit.py\n")
+ suite = unittest.makeSuite(TestEdit)
+ result=unittest.TextTestRunner(f, descriptions=1, verbosity=1).run(suite)
+ sys.exit(not result.wasSuccessful())