diff --git a/tests/test_arch.py b/tests/test_arch.py index f98b4555..f7670419 100644 --- a/tests/test_arch.py +++ b/tests/test_arch.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- import mock @@ -92,7 +91,3 @@ class TestExclusiveExcludeArch(unittest.TestCase): self.assertTrue(is_excluded(pkg, ['x86_64'], logger=log)) self.assertEqual(log.mock_calls, [mock.call.debug("Excluding (EXCLUSIVEARCH: ['aarch64']): pkg.rpm")]) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_buildinstall.py b/tests/test_buildinstall.py index 7816a89b..07c08d02 100644 --- a/tests/test_buildinstall.py +++ b/tests/test_buildinstall.py @@ -1,11 +1,6 @@ -#!/usr/bin/env python2 # -*- coding: utf-8 -*- -try: - import unittest2 as unittest -except ImportError: - import unittest import mock import os @@ -1015,7 +1010,3 @@ class TestTweakConfigs(PungiTestCase): self.assertEqual( f.read().strip(), ':LABEL=new\\\\x20volid ks=hd:LABEL=new\\\\x20volid:/ks.cfg') - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_compose.py b/tests/test_compose.py index a1bdde8c..234a9ce0 100644 --- a/tests/test_compose.py +++ b/tests/test_compose.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8 -*- import mock @@ -521,7 +520,3 @@ class StatusTest(unittest.TestCase): self.compose.conf['gather_backend'] = 'yum' self.compose.conf['createrepo_database'] = False self.assertFalse(self.compose.should_create_yum_database) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_config.py b/tests/test_config.py index 549873eb..f6c57f2f 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- @@ -483,7 +482,3 @@ class SkipPhasesTestCase(ConfigTestCase): skip_phases=skip_phases, ) self.assertNotEqual(checks.validate(cfg), ([], [])) - - -if __name__ == '__main__': - unittest.main() diff --git a/tests/test_createiso_phase.py b/tests/test_createiso_phase.py index d87a82c0..ef836929 100644 --- a/tests/test_createiso_phase.py +++ b/tests/test_createiso_phase.py @@ -1,11 +1,6 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- -try: - import unittest2 as unittest -except ImportError: - import unittest import mock import os @@ -942,7 +937,3 @@ class TweakTreeinfo(helpers.PungiTestCase): ti.dump(output) self.assertFilesEqual(output, expected) - - -if __name__ == '__main__': - unittest.main() diff --git a/tests/test_createiso_script.py b/tests/test_createiso_script.py index 0a2259bc..631a54d3 100644 --- a/tests/test_createiso_script.py +++ b/tests/test_createiso_script.py @@ -1,7 +1,5 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- -import unittest import mock import os @@ -218,7 +216,3 @@ class CreateIsoScriptTest(helpers.PungiTestCase): '--template=%s/jigdo/DP-1.0-20160405.t.3-x86_64.iso.template' % self.topdir, '--no-servers-section', '--report=noprogress', self.topdir + '/os//'])] ) - - -if __name__ == '__main__': - unittest.main() diff --git a/tests/test_createrepo_wrapper.py b/tests/test_createrepo_wrapper.py index 3b75b53e..67727e84 100644 --- a/tests/test_createrepo_wrapper.py +++ b/tests/test_createrepo_wrapper.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8 -*- try: diff --git a/tests/test_createrepophase.py b/tests/test_createrepophase.py index c7c43c5d..520f8214 100644 --- a/tests/test_createrepophase.py +++ b/tests/test_createrepophase.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8 -*- diff --git a/tests/test_extra_files_phase.py b/tests/test_extra_files_phase.py index cbdd39df..053ce17b 100644 --- a/tests/test_extra_files_phase.py +++ b/tests/test_extra_files_phase.py @@ -1,10 +1,8 @@ -#!/usr/bin/env python2 # -*- coding: utf-8 -*- import mock import os import sys -import unittest sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) @@ -169,7 +167,3 @@ class TestCopyFiles(helpers.PungiTestCase): self.assertEqual(len(get_file_from_scm.call_args_list), 0) self.assertEqual(get_dir_from_scm.call_args_list, []) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_extra_isos_phase.py b/tests/test_extra_isos_phase.py index 09efed1a..e63490c3 100644 --- a/tests/test_extra_isos_phase.py +++ b/tests/test_extra_isos_phase.py @@ -1,11 +1,6 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- -try: - import unittest2 as unittest -except ImportError: - import unittest import mock import os @@ -922,7 +917,3 @@ class PrepareMetadataTest(helpers.PungiTestCase): ), ], ) - - -if __name__ == '__main__': - unittest.main() diff --git a/tests/test_graph.py b/tests/test_graph.py index 977ce2a2..0f053dea 100644 --- a/tests/test_graph.py +++ b/tests/test_graph.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8 -*- try: diff --git a/tests/test_imagebuildphase.py b/tests/test_imagebuildphase.py index d163929c..d9e06def 100644 --- a/tests/test_imagebuildphase.py +++ b/tests/test_imagebuildphase.py @@ -1,11 +1,5 @@ -#!/usr/bin/env python2 # -*- coding: utf-8 -*- - -try: - import unittest2 as unittest -except ImportError: - import unittest import mock import os @@ -993,7 +987,3 @@ class TestCreateImageBuildThread(PungiTestCase): with self.assertRaises(RuntimeError): with mock.patch('time.sleep'): t.process((compose, cmd), 1) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_imagechecksumphase.py b/tests/test_imagechecksumphase.py index e60d212c..9934ca45 100644 --- a/tests/test_imagechecksumphase.py +++ b/tests/test_imagechecksumphase.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- try: @@ -198,7 +197,3 @@ class TestDumpChecksums(unittest.TestCase): 'MD5 (file2.iso) = cafebabe', ] self.assertEqual(expected, data) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_initphase.py b/tests/test_initphase.py index 964913d6..c3bb7697 100644 --- a/tests/test_initphase.py +++ b/tests/test_initphase.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- @@ -557,7 +556,3 @@ class TestValidateComps(unittest.TestCase): self.assertEqual( CompsWrapper.mock_calls, [mock.call("/path"), mock.call().validate()] ) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_koji_wrapper.py b/tests/test_koji_wrapper.py index 399bb907..cd0bba2f 100644 --- a/tests/test_koji_wrapper.py +++ b/tests/test_koji_wrapper.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8 -*- import json @@ -801,7 +800,3 @@ class TestGetBuildrootRPMs(unittest.TestCase): 'kbd-2.0.2-8.fc23.x86_64', 'coreutils-8.24-6.fc23.x86_64', ]) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_linker.py b/tests/test_linker.py index d922dac1..082b5a6c 100644 --- a/tests/test_linker.py +++ b/tests/test_linker.py @@ -1,13 +1,8 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- import mock import errno -try: - import unittest2 as unittest -except ImportError: - import unittest import os import stat import sys @@ -342,7 +337,3 @@ class TestLinkerLink(TestLinkerBase): self.assertTrue(self.same_inode(self.file1, self.hardlink1)) self.linker.link(self.src_dir, self.dst_dir, link_type="copy") self.assertTrue(self.same_inode(self.dst_file1, self.dst_hardlink1)) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_liveimagesphase.py b/tests/test_liveimagesphase.py index b2a906ae..c5150aaa 100644 --- a/tests/test_liveimagesphase.py +++ b/tests/test_liveimagesphase.py @@ -1,8 +1,6 @@ -#!/usr/bin/env python2 # -*- coding: utf-8 -*- -import unittest import mock import os @@ -768,7 +766,3 @@ class TestCreateLiveImageThread(PungiTestCase): mock.call('[FAIL] Live (variant Client, arch amd64, subvariant Client) failed, but going on anyway.'), mock.call('BOOM') ]) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_livemediaphase.py b/tests/test_livemediaphase.py index dba5c155..91727a33 100644 --- a/tests/test_livemediaphase.py +++ b/tests/test_livemediaphase.py @@ -1,7 +1,5 @@ -#!/usr/bin/env python2 # -*- coding: utf-8 -*- -import unittest import mock import sys @@ -679,7 +677,3 @@ class TestLiveMediaThread(PungiTestCase): 'name': 'Fedora Server Live', 'repo': ['/repo/$basearch/Server'], })]) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_media_split.py b/tests/test_media_split.py index fa6e7dbc..9e7494cd 100644 --- a/tests/test_media_split.py +++ b/tests/test_media_split.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8 -*- try: @@ -141,7 +140,3 @@ class MediaSplitterTestCase(unittest.TestCase): self.assertEqual(ms.split(), [{'files': ['first', 'second', 'third'], 'size': bl(145)}]) self.assertUnlimited(bl(25 + 40 + 80)) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_metadata.py b/tests/test_metadata.py index a8c9e58c..0330b4a7 100644 --- a/tests/test_metadata.py +++ b/tests/test_metadata.py @@ -1,8 +1,5 @@ -#!/usr/bin/env python2 -# -*- coding: utf-8 -*- import json import mock -import unittest import os import sys @@ -247,7 +244,3 @@ class TestWriteExtraFiles(helpers.PungiTestCase): files.append('missing_file') self.assertRaises(RuntimeError, metadata.write_extra_files, tree_dir, files, 'sha256', mock_logger) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_notifier.py b/tests/test_notifier.py index 9f334304..89161e8d 100644 --- a/tests/test_notifier.py +++ b/tests/test_notifier.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- from datetime import datetime @@ -142,7 +141,3 @@ class TestNotifier(unittest.TestCase): self.assertEqual(run.call_args_list, [self._call('run-notify', 'cmd')]) self.assertTrue(self.compose.log_warning.called) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_osbs_phase.py b/tests/test_osbs_phase.py index 871e92d2..914fed73 100644 --- a/tests/test_osbs_phase.py +++ b/tests/test_osbs_phase.py @@ -1,10 +1,5 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- -try: - import unittest2 as unittest -except ImportError: - import unittest import mock import json @@ -561,7 +556,3 @@ class OSBSThreadTest(helpers.PungiTestCase): self._assertCorrectCalls({'git_branch': 'f24-docker'}, scratch=True) self._assertCorrectMetadata(scratch=True) self._assertRepoFile() - - -if __name__ == '__main__': - unittest.main() diff --git a/tests/test_ostree_installer_phase.py b/tests/test_ostree_installer_phase.py index 2d984608..0cce4b83 100644 --- a/tests/test_ostree_installer_phase.py +++ b/tests/test_ostree_installer_phase.py @@ -1,8 +1,5 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- - -import unittest import mock import os @@ -633,7 +630,3 @@ class OstreeThreadTest(helpers.PungiTestCase): mock.call('Runroot task failed: 1234. See %s/%s/runroot.log for more details.' % (self.topdir, LOG_PATH)) ]) - - -if __name__ == '__main__': - unittest.main() diff --git a/tests/test_ostree_phase.py b/tests/test_ostree_phase.py index ed3a5563..6b7c931e 100644 --- a/tests/test_ostree_phase.py +++ b/tests/test_ostree_phase.py @@ -1,9 +1,7 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- import json -import unittest import mock import os @@ -507,7 +505,3 @@ class OSTreeThreadTest(helpers.PungiTestCase): 'http://example.com/work/$basearch/comps_repo_Everything') self.assertEqual(extra_config.get("repo").pop()["baseurl"], "http://example.com/repo/1") self.assertEqual(extra_config.get('repo').pop()['baseurl'], 'http://url/to/repo/a') - - -if __name__ == '__main__': - unittest.main() diff --git a/tests/test_ostree_script.py b/tests/test_ostree_script.py index 9490d935..1751e6b1 100644 --- a/tests/test_ostree_script.py +++ b/tests/test_ostree_script.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- diff --git a/tests/test_pathmatch.py b/tests/test_pathmatch.py index 12f182d3..2c116415 100644 --- a/tests/test_pathmatch.py +++ b/tests/test_pathmatch.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- @@ -66,7 +65,3 @@ class TestPathMatch(unittest.TestCase): self.assertEqual(sorted(self.pm["/lib"]), ["/star2"]) self.assertEqual(sorted(self.pm["/lib/foo"]), ["/star/star1", "/star2"]) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_phase_base.py b/tests/test_phase_base.py index 7ac0f522..a052e7d3 100644 --- a/tests/test_phase_base.py +++ b/tests/test_phase_base.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8 -*- import mock @@ -135,7 +134,3 @@ class TestWeaver(unittest.TestCase): self.assertMissed(self.p4) self.assertFinalized(self.p5) self.assertFinalized(self.p6) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_pkgset_common.py b/tests/test_pkgset_common.py index 03321a9c..a72fadaf 100755 --- a/tests/test_pkgset_common.py +++ b/tests/test_pkgset_common.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8 -*- import os diff --git a/tests/test_pkgset_pkgsets.py b/tests/test_pkgset_pkgsets.py index e7099b10..a25ed302 100644 --- a/tests/test_pkgset_pkgsets.py +++ b/tests/test_pkgset_pkgsets.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8 -*- import mock @@ -593,7 +592,3 @@ class TestSaveFileList(unittest.TestCase): rpms = f.read().strip().split('\n') self.assertItemsEqual(rpms, ['pungi@4.1.3@3.fc25@noarch', 'pungi@4.1.3@3.fc25@src']) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_scm.py b/tests/test_scm.py index 0b75bc47..aa9ce7cb 100644 --- a/tests/test_scm.py +++ b/tests/test_scm.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8 -*- import mock @@ -399,7 +398,3 @@ class CvsSCMTestCase(SCMBaseTest): self.assertEqual( commands, ['/usr/bin/cvs -q -d http://example.com/cvs export -r HEAD subdir']) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_test_phase.py b/tests/test_test_phase.py index ff2e8e66..e6d8eafc 100644 --- a/tests/test_test_phase.py +++ b/tests/test_test_phase.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- @@ -434,7 +433,3 @@ class TestRepoclosure(PungiTestCase): with self.assertRaises(RuntimeError): test_phase.run_repoclosure(compose) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_unified_isos.py b/tests/test_unified_isos.py index 8e16540c..966f2f21 100755 --- a/tests/test_unified_isos.py +++ b/tests/test_unified_isos.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- import mock diff --git a/tests/test_util.py b/tests/test_util.py index 7e44d957..92dc3c68 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8 -*- import argparse @@ -873,7 +872,3 @@ class TestCopyAll(PungiTestCase): self.assertTrue(os.path.islink(os.path.join(self.dst, "symlink"))) self.assertEqual(os.readlink(os.path.join(self.dst, "symlink")), "broken") - - -if __name__ == "__main__": - unittest.main()