提交 88f6998b 编写于 作者: L Lukáš Doktor

Pylint fixes

Recent pylint update is more pedantic about module level spacing. There
are no changes to code, only couple of extra spaces to make it happy.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 9047e29f
......@@ -208,6 +208,7 @@ class _TmpDirTracker(Borg):
except AttributeError:
pass
_tmp_tracker = _TmpDirTracker()
......
......@@ -238,6 +238,7 @@ def uncompress(filename, path):
with ArchiveFile.open(filename) as x:
x.extract(path)
# Some aliases
create = compress
extract = uncompress
......@@ -354,6 +354,7 @@ def __private():
return (GdbMiScanner(), GdbMiParser(), GdbMiInterpreter, GdbMiRecord)
(__the_scanner, __the_parser, __the_interpreter, __the_output) = __private()
......
......@@ -785,6 +785,7 @@ def service_manager(run=process.run):
internal_parser(run))
return _service_manager
ServiceManager = service_manager
......@@ -847,4 +848,5 @@ def specific_service_manager(service_name, run=process.run):
specific_generator(run),
_get_service_result_parser(run), run)
SpecificServiceManager = specific_service_manager
......@@ -66,5 +66,6 @@ def symlink_coredumps():
except Exception:
pass
if __name__ == "__main__":
symlink_coredumps()
......@@ -39,5 +39,6 @@ class DoubleFreeTest(Test):
cmd_result = process.run(cmd)
self.log.info(cmd_result)
if __name__ == "__main__":
main()
......@@ -16,5 +16,6 @@ class ErrorTest(Test):
"""
self.error('This should end with ERROR.')
if __name__ == "__main__":
main()
......@@ -22,5 +22,6 @@ class FailOnException(avocado.Test):
"""
raise ValueError('This raises a ValueError and should end as a FAIL')
if __name__ == "__main__":
avocado.main()
......@@ -33,5 +33,6 @@ class MultipleTests(Test):
"""
raise Exception('This action method should never be executed.')
if __name__ == '__main__':
main()
......@@ -19,5 +19,6 @@ class SkipOutsideSetup(avocado.Test):
"""
self.skip('Calling skip() outside setUp() will result in ERROR')
if __name__ == "__main__":
avocado.main()
......@@ -22,5 +22,6 @@ class SkipOnSetupTest(Test):
"""
pass
if __name__ == "__main__":
main()
......@@ -32,5 +32,6 @@ class SleepTenMin(Test):
elif method == 'shell':
os.system("sleep %s" % length)
if __name__ == "__main__":
main()
......@@ -16,5 +16,6 @@ class ErrorTest(Test):
"""
raise Exception("This is a generic exception")
if __name__ == "__main__":
main()
......@@ -16,5 +16,6 @@ class WarnTest(Test):
"""
self.log.warn("This marks test as WARN")
if __name__ == "__main__":
main()
......@@ -38,5 +38,6 @@ class WhiteBoard(Test):
result += data
self.whiteboard = base64.encodestring(result)
if __name__ == "__main__":
main()
......@@ -55,6 +55,7 @@ def handle_exception(*exc_info):
# imported because we are dealing with import failures
sys.exit(-1)
if __name__ == '__main__':
sys.excepthook = handle_exception
......@@ -66,8 +67,10 @@ if os.path.isdir(os.path.join(basedir, 'avocado')):
os.environ['PATH'] += ":" + os.path.join(basedir, 'libexec')
sys.path.append(basedir)
from avocado.core.app import AvocadoApp
if __name__ == '__main__':
# Override tmp in case it's not set in env
for attr in ("TMP", "TEMP", "TMPDIR"):
......
......@@ -42,6 +42,7 @@ class Parser(argparse.ArgumentParser):
'will show a human readable report for the '
'given result file'))
RESULT_MAP = {"P": "PASS",
"p": "PASS",
"F": "FAIL",
......@@ -167,6 +168,7 @@ class App(object):
print("%s: %s" % (name, out))
return 0
if __name__ == '__main__':
app = App()
sys.exit(app.run())
......@@ -72,5 +72,6 @@ class ArgumentParsingErrorEarlyTest(unittest.TestCase):
self.run_but_fail_before_create_job_dir('--whacky-option passtest',
exit_codes.AVOCADO_FAIL)
if __name__ == '__main__':
unittest.main()
......@@ -105,6 +105,7 @@ def probe_binary(binary):
except utils_path.CmdNotFoundError:
return None
CC_BINARY = probe_binary('cc')
ECHO_BINARY = probe_binary('echo')
READ_BINARY = probe_binary('read')
......@@ -1152,5 +1153,6 @@ class PluginsJSONTest(AbsPluginsTest, unittest.TestCase):
shutil.rmtree(self.tmpdir)
super(PluginsJSONTest, self).tearDown()
if __name__ == '__main__':
unittest.main()
......@@ -62,5 +62,6 @@ class EnvironmentVariablesTest(unittest.TestCase):
self.script.remove()
shutil.rmtree(self.tmpdir)
if __name__ == '__main__':
unittest.main()
......@@ -36,5 +36,6 @@ class GDBPluginTest(unittest.TestCase):
def tearDown(self):
shutil.rmtree(self.tmpdir)
if __name__ == '__main__':
unittest.main()
......@@ -182,5 +182,6 @@ class InterruptTest(unittest.TestCase):
def tearDown(self):
shutil.rmtree(self.tmpdir)
if __name__ == '__main__':
unittest.main()
......@@ -168,5 +168,6 @@ class JobTimeOutTest(unittest.TestCase):
self.py.remove()
shutil.rmtree(self.tmpdir)
if __name__ == '__main__':
unittest.main()
......@@ -138,5 +138,6 @@ class MultiplexTests(unittest.TestCase):
def tearDown(self):
shutil.rmtree(self.tmpdir)
if __name__ == '__main__':
unittest.main()
......@@ -118,5 +118,6 @@ class RunnerSimpleTest(unittest.TestCase):
self.output_script.remove()
shutil.rmtree(self.tmpdir)
if __name__ == '__main__':
unittest.main()
......@@ -75,5 +75,6 @@ class StandaloneTests(unittest.TestCase):
expected_rc = exit_codes.AVOCADO_TESTS_FAIL
self.run_and_check(cmd_line, expected_rc, 'errortest')
if __name__ == '__main__':
unittest.main()
......@@ -70,5 +70,6 @@ class SysInfoTest(unittest.TestCase):
def tearDown(self):
shutil.rmtree(self.tmpdir)
if __name__ == '__main__':
unittest.main()
......@@ -28,5 +28,6 @@ class TestThirdPartyBugs(unittest.TestCase):
except download.urllib2.URLError as details:
raise unittest.SkipTest(details)
if __name__ == '__main__':
unittest.main()
......@@ -89,5 +89,6 @@ class UnittestCompat(unittest.TestCase):
self.assertIn('This test is supposed to error', result.stderr)
self.assertIn('FAILED (errors=1)', result.stderr)
if __name__ == '__main__':
unittest.main()
......@@ -26,6 +26,7 @@ def test_suite():
top_level_dir=basedir))
return suite
if __name__ == '__main__':
runner = unittest.TextTestRunner(failfast=not os.environ.get("SELF_CHECK_CONTINUOUS"))
result = runner.run(test_suite())
......
......@@ -39,5 +39,6 @@ class AstringTest(unittest.TestCase):
"avocado 123")
self.assertEqual(astring.tabular_output(matrix), str_matrix)
if __name__ == '__main__':
unittest.main()
......@@ -110,5 +110,6 @@ class DataDirTest(unittest.TestCase):
if hasattr(self, 'alt_mapping'):
shutil.rmtree(self.alt_mapping['base_dir'])
if __name__ == '__main__':
unittest.main()
......@@ -23,5 +23,6 @@ class DispatcherTest(unittest.TestCase):
self.assertEqual(names, sorted(names))
self.assertEqual(ext_names, sorted(ext_names))
if __name__ == '__main__':
unittest.main()
......@@ -119,5 +119,6 @@ class JobTest(unittest.TestCase):
self.assertEqual(myjob.unique_id[::-1],
open(os.path.join(myjob.logdir, "reversed_id")).read())
if __name__ == '__main__':
unittest.main()
......@@ -182,5 +182,6 @@ class RemoteTestRunnerSetup(unittest.TestCase):
self.runner.setup()
flexmock_teardown()
if __name__ == '__main__':
unittest.main()
......@@ -54,5 +54,6 @@ class ResultResponseTest(unittest.TestCase):
response.ResultResponse,
self.BAD_DATA_RESULTS)
if __name__ == '__main__':
unittest.main()
......@@ -101,5 +101,6 @@ class SettingsTest(unittest.TestCase):
def tearDown(self):
os.unlink(self.config_file.name)
if __name__ == '__main__':
unittest.main()
......@@ -93,5 +93,6 @@ class SysinfoTest(unittest.TestCase):
def tearDown(self):
shutil.rmtree(self.tmpdir)
if __name__ == '__main__':
unittest.main()
......@@ -249,5 +249,6 @@ class SkipTest(unittest.TestCase):
except Exception:
pass
if __name__ == '__main__':
unittest.main()
......@@ -216,5 +216,6 @@ class TestPathParent(unittest.TestCase):
def test_false_direct_parent(self):
self.assertNotEqual(tree.path_parent('/os/linux'), '/')
if __name__ == '__main__':
unittest.main()
......@@ -100,5 +100,6 @@ class TestAsset(unittest.TestCase):
def tearDown(self):
shutil.rmtree(self.basedir)
if __name__ == "__main__":
unittest.main()
......@@ -36,5 +36,6 @@ class TestFileLock(unittest.TestCase):
def tearDown(self):
shutil.rmtree(self.basedir)
if __name__ == "__main__":
unittest.main()
......@@ -218,5 +218,6 @@ class MiscProcessTests(unittest.TestCase):
res = process.binary_from_shell_cmd("FOO=bar ./bin var=value")
self.assertEqual("./bin", res)
if __name__ == "__main__":
unittest.main()
......@@ -80,5 +80,6 @@ class TestUnpickableObject(unittest.TestCase):
ListWithUnpickableAttribute(ListWithUnpickableAttribute(
[InClassUnpickable()]))])
if __name__ == '__main__':
unittest.main()
......@@ -67,5 +67,6 @@ class VMTestRunnerSetup(unittest.TestCase):
self.runner.tear_down()
flexmock_teardown()
if __name__ == '__main__':
unittest.main()
......@@ -102,6 +102,7 @@ def get_long_description():
req_contents = req.read()
return req_contents
if __name__ == '__main__':
setup(name='avocado-framework',
version=VERSION,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册