From 6cd3aed0077d6cced71417a48f92527ef1ecbd3e Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Thu, 23 Nov 2017 00:00:47 +0000 Subject: Remove main() and __main__ from tests. Removes the unnecessary main() functions from tests. Also removes shebang (#!) where it appears at the top of files. JIRA: YARDSTICK-861 Change-Id: I79180d1eb9c5bce640142dd62ce28c7437c1b210 Signed-off-by: Emma Foley --- .../tests/unit/benchmark/scenarios/compute/test_cachestat.py | 2 -- .../unit/benchmark/scenarios/compute/test_computecapacity.py | 2 -- .../tests/unit/benchmark/scenarios/compute/test_cpuload.py | 2 -- .../tests/unit/benchmark/scenarios/compute/test_cyclictest.py | 9 --------- .../tests/unit/benchmark/scenarios/compute/test_lmbench.py | 9 --------- .../tests/unit/benchmark/scenarios/compute/test_memload.py | 10 ---------- .../tests/unit/benchmark/scenarios/compute/test_plugintest.py | 2 -- .../tests/unit/benchmark/scenarios/compute/test_qemumigrate.py | 10 ---------- .../tests/unit/benchmark/scenarios/compute/test_ramspeed.py | 9 --------- .../tests/unit/benchmark/scenarios/compute/test_spec_cpu.py | 10 ---------- .../unit/benchmark/scenarios/compute/test_spec_cpu_for_vm.py | 8 -------- .../tests/unit/benchmark/scenarios/compute/test_unixbench.py | 9 --------- 12 files changed, 82 deletions(-) (limited to 'yardstick/tests/unit/benchmark/scenarios/compute') diff --git a/yardstick/tests/unit/benchmark/scenarios/compute/test_cachestat.py b/yardstick/tests/unit/benchmark/scenarios/compute/test_cachestat.py index b0ddfc6b4..6f66c30f9 100644 --- a/yardstick/tests/unit/benchmark/scenarios/compute/test_cachestat.py +++ b/yardstick/tests/unit/benchmark/scenarios/compute/test_cachestat.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################## # Copyright (c) 2016 Huawei Technologies Co.,Ltd and others. # diff --git a/yardstick/tests/unit/benchmark/scenarios/compute/test_computecapacity.py b/yardstick/tests/unit/benchmark/scenarios/compute/test_computecapacity.py index 7b9a5ad4a..4bef589f4 100644 --- a/yardstick/tests/unit/benchmark/scenarios/compute/test_computecapacity.py +++ b/yardstick/tests/unit/benchmark/scenarios/compute/test_computecapacity.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################## # Copyright (c) 2016 Huawei Technologies Co.,Ltd and others. # diff --git a/yardstick/tests/unit/benchmark/scenarios/compute/test_cpuload.py b/yardstick/tests/unit/benchmark/scenarios/compute/test_cpuload.py index 840ac7885..da6e6a22e 100644 --- a/yardstick/tests/unit/benchmark/scenarios/compute/test_cpuload.py +++ b/yardstick/tests/unit/benchmark/scenarios/compute/test_cpuload.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################## # Copyright (c) 2015 Ericsson AB and others. # diff --git a/yardstick/tests/unit/benchmark/scenarios/compute/test_cyclictest.py b/yardstick/tests/unit/benchmark/scenarios/compute/test_cyclictest.py index 51ffd2488..f24ec24ec 100644 --- a/yardstick/tests/unit/benchmark/scenarios/compute/test_cyclictest.py +++ b/yardstick/tests/unit/benchmark/scenarios/compute/test_cyclictest.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################## # Copyright (c) 2015 Huawei Technologies Co.,Ltd and other. # @@ -166,10 +164,3 @@ class CyclictestTestCase(unittest.TestCase): mock_ssh.SSH.from_node().execute.return_value = (1, '', 'FOOBAR') self.assertRaises(RuntimeError, c.run, result) - - -def main(): - unittest.main() - -if __name__ == '__main__': - main() diff --git a/yardstick/tests/unit/benchmark/scenarios/compute/test_lmbench.py b/yardstick/tests/unit/benchmark/scenarios/compute/test_lmbench.py index b3152d12c..9640ce000 100644 --- a/yardstick/tests/unit/benchmark/scenarios/compute/test_lmbench.py +++ b/yardstick/tests/unit/benchmark/scenarios/compute/test_lmbench.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################## # Copyright (c) 2015 Ericsson AB and others. # @@ -193,10 +191,3 @@ class LmbenchTestCase(unittest.TestCase): mock_ssh.SSH.from_node().execute.return_value = (1, '', 'FOOBAR') self.assertRaises(RuntimeError, l.run, self.result) - - -def main(): - unittest.main() - -if __name__ == '__main__': - main() diff --git a/yardstick/tests/unit/benchmark/scenarios/compute/test_memload.py b/yardstick/tests/unit/benchmark/scenarios/compute/test_memload.py index ebae9993d..8213d4490 100644 --- a/yardstick/tests/unit/benchmark/scenarios/compute/test_memload.py +++ b/yardstick/tests/unit/benchmark/scenarios/compute/test_memload.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################## # Copyright (c) 2016 Huawei Technologies Co.,Ltd and others. # @@ -109,11 +107,3 @@ class MEMLoadTestCase(unittest.TestCase): with open(output) as f: sample_output = f.read() return sample_output - - -def main(): - unittest.main() - - -if __name__ == '__main__': - main() diff --git a/yardstick/tests/unit/benchmark/scenarios/compute/test_plugintest.py b/yardstick/tests/unit/benchmark/scenarios/compute/test_plugintest.py index 680f6ad65..875301729 100644 --- a/yardstick/tests/unit/benchmark/scenarios/compute/test_plugintest.py +++ b/yardstick/tests/unit/benchmark/scenarios/compute/test_plugintest.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################## # Copyright (c) 2016 Huawei Technologies Co.,Ltd and others. # diff --git a/yardstick/tests/unit/benchmark/scenarios/compute/test_qemumigrate.py b/yardstick/tests/unit/benchmark/scenarios/compute/test_qemumigrate.py index 26a26cdf7..03003d01f 100644 --- a/yardstick/tests/unit/benchmark/scenarios/compute/test_qemumigrate.py +++ b/yardstick/tests/unit/benchmark/scenarios/compute/test_qemumigrate.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################## # Copyright (c) 2015 Huawei Technologies Co.,Ltd and other. # @@ -157,11 +155,3 @@ class QemuMigrateTestCase(unittest.TestCase): mock_ssh.SSH.from_node().execute.return_value = (1, '', 'FOOBAR') self.assertRaises(RuntimeError, q.run, result) - - -def main(): - unittest.main() - - -if __name__ == '__main__': - main() diff --git a/yardstick/tests/unit/benchmark/scenarios/compute/test_ramspeed.py b/yardstick/tests/unit/benchmark/scenarios/compute/test_ramspeed.py index 4f71fbb36..dcc0e810d 100644 --- a/yardstick/tests/unit/benchmark/scenarios/compute/test_ramspeed.py +++ b/yardstick/tests/unit/benchmark/scenarios/compute/test_ramspeed.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################## # Copyright (c) 2016 Huawei Technologies Co.,Ltd and others. # @@ -235,10 +233,3 @@ class RamspeedTestCase(unittest.TestCase): mock_ssh.SSH.from_node().execute.return_value = (1, '', 'No such type_id: 30 for \ Ramspeed scenario') self.assertRaises(RuntimeError, r.run, self.result) - - -def main(): - unittest.main() - -if __name__ == '__main__': - main() diff --git a/yardstick/tests/unit/benchmark/scenarios/compute/test_spec_cpu.py b/yardstick/tests/unit/benchmark/scenarios/compute/test_spec_cpu.py index 74612d7b6..643e1eae2 100644 --- a/yardstick/tests/unit/benchmark/scenarios/compute/test_spec_cpu.py +++ b/yardstick/tests/unit/benchmark/scenarios/compute/test_spec_cpu.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################## # Copyright (c) 2017 Huawei Technologies Co.,Ltd and others. # @@ -75,11 +73,3 @@ class SpecCPUTestCase(unittest.TestCase): mock_ssh.SSH.from_node().execute.return_value = (1, '', 'FOOBAR') self.assertRaises(RuntimeError, s.run, self.result) - - -def main(): - unittest.main() - - -if __name__ == '__main__': - main() diff --git a/yardstick/tests/unit/benchmark/scenarios/compute/test_spec_cpu_for_vm.py b/yardstick/tests/unit/benchmark/scenarios/compute/test_spec_cpu_for_vm.py index c428e1fb8..74ef576b6 100644 --- a/yardstick/tests/unit/benchmark/scenarios/compute/test_spec_cpu_for_vm.py +++ b/yardstick/tests/unit/benchmark/scenarios/compute/test_spec_cpu_for_vm.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################## # Copyright (c) 2017 Huawei Technologies Co.,Ltd and others. # @@ -76,9 +74,3 @@ class SpecCPUforVMTestCase(unittest.TestCase): mock_ssh.SSH.from_node().execute.return_value = (1, '', 'FOOBAR') self.assertRaises(RuntimeError, s.run, self.result) - -def main(): - unittest.main() - -if __name__ == '__main__': - main() diff --git a/yardstick/tests/unit/benchmark/scenarios/compute/test_unixbench.py b/yardstick/tests/unit/benchmark/scenarios/compute/test_unixbench.py index fec355b45..6339a2dcd 100644 --- a/yardstick/tests/unit/benchmark/scenarios/compute/test_unixbench.py +++ b/yardstick/tests/unit/benchmark/scenarios/compute/test_unixbench.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################## # Copyright (c) 2015 Huawei Technologies Co.,Ltd and other. # @@ -162,10 +160,3 @@ class UnixbenchTestCase(unittest.TestCase): mock_ssh.SSH.from_node().execute.return_value = (1, '', 'FOOBAR') self.assertRaises(RuntimeError, u.run, result) - - -def main(): - unittest.main() - -if __name__ == '__main__': - main() -- cgit 1.2.3-korg