[tests] update the way test scripts are executed when directly called
This commit is contained in:
@@ -182,3 +182,5 @@ if __name__ == '__main__':
|
||||
etpUi['debug'] = True
|
||||
unittest.main()
|
||||
entropy.tools.kill_threads()
|
||||
raise SystemExit(0)
|
||||
|
||||
|
||||
@@ -54,3 +54,5 @@ if __name__ == '__main__':
|
||||
from entropy.const import etpUi
|
||||
etpUi['debug'] = True
|
||||
unittest.main()
|
||||
entropy.tools.kill_threads()
|
||||
raise SystemExit(0)
|
||||
|
||||
@@ -450,3 +450,4 @@ if __name__ == '__main__':
|
||||
etpUi['debug'] = True
|
||||
unittest.main()
|
||||
entropy.tools.kill_threads()
|
||||
raise SystemExit(0)
|
||||
|
||||
@@ -63,3 +63,4 @@ if __name__ == '__main__':
|
||||
etpUi['debug'] = True
|
||||
unittest.main()
|
||||
entropy.tools.kill_threads()
|
||||
raise SystemExit(0)
|
||||
|
||||
@@ -110,4 +110,10 @@ class MiscTest(unittest.TestCase):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if "--debug" in sys.argv:
|
||||
sys.argv.remove("--debug")
|
||||
from entropy.const import etpUi
|
||||
etpUi['debug'] = True
|
||||
unittest.main()
|
||||
entropy.tools.kill_threads()
|
||||
raise SystemExit(0)
|
||||
|
||||
@@ -117,4 +117,10 @@ class MiscTest(unittest.TestCase):
|
||||
sender.send_text_email(mail_sender, mail_recipients, mail_sub, mail_msg)
|
||||
|
||||
if __name__ == '__main__':
|
||||
if "--debug" in sys.argv:
|
||||
sys.argv.remove("--debug")
|
||||
from entropy.const import etpUi
|
||||
etpUi['debug'] = True
|
||||
unittest.main()
|
||||
entropy.tools.kill_threads()
|
||||
raise SystemExit(0)
|
||||
|
||||
@@ -39,4 +39,5 @@ if __name__ == '__main__':
|
||||
from entropy.const import etpUi
|
||||
etpUi['debug'] = True
|
||||
unittest.main()
|
||||
entropy.tools.kill_threads()
|
||||
entropy.tools.kill_threads()
|
||||
raise SystemExit(0)
|
||||
|
||||
@@ -127,4 +127,5 @@ if __name__ == '__main__':
|
||||
from entropy.const import etpUi
|
||||
etpUi['debug'] = True
|
||||
unittest.main()
|
||||
entropy.tools.kill_threads()
|
||||
entropy.tools.kill_threads()
|
||||
raise SystemExit(0)
|
||||
|
||||
@@ -26,6 +26,9 @@ class EntropyRepositoryTest(unittest.TestCase):
|
||||
# create fake server repo
|
||||
self.Server = Server(fake_default_repo_id = self.default_repo,
|
||||
fake_default_repo_desc = 'foo desc', fake_default_repo = True)
|
||||
foo_db = self.Server.open_server_repository(repo = self.default_repo,
|
||||
read_only = False, lock_remote = False, is_new = True)
|
||||
foo_db.initializeDatabase()
|
||||
|
||||
|
||||
def tearDown(self):
|
||||
@@ -34,6 +37,7 @@ class EntropyRepositoryTest(unittest.TestCase):
|
||||
"""
|
||||
sys.stdout.write("%s ran\n" % (self,))
|
||||
sys.stdout.flush()
|
||||
self.Server.Cacher.stop()
|
||||
self.Server.destroy()
|
||||
|
||||
def test_server_instance(self):
|
||||
@@ -63,3 +67,4 @@ if __name__ == '__main__':
|
||||
etpUi['debug'] = True
|
||||
unittest.main()
|
||||
entropy.tools.kill_threads()
|
||||
raise SystemExit(0)
|
||||
|
||||
@@ -146,3 +146,4 @@ if __name__ == '__main__':
|
||||
etpUi['debug'] = True
|
||||
unittest.main()
|
||||
et.kill_threads()
|
||||
raise SystemExit(0)
|
||||
|
||||
@@ -709,3 +709,4 @@ if __name__ == '__main__':
|
||||
etpUi['debug'] = True
|
||||
unittest.main()
|
||||
et.kill_threads()
|
||||
raise SystemExit(0)
|
||||
|
||||
Reference in New Issue
Block a user