* replaces /usr/bin/python with /usr/bin/env python inside test cases. NOTE: I don't see any executable tests/*.py files but maybe this is a good measure. Otherwise this line doesn't have any effect and can be removed.
There are still a few places which use hard-coded python version:
* Makefile uses PYTHON=python2 which is used in a few places calling setup.py * some scripts/ use /usr/bin/python explicitly * runpylint.py uses /usr/bin/python3 explicitly
From: Alexander Todorov atodorov@redhat.com
These conflict with Python2/3 compatibility. --- tests/action_test.py | 4 ---- tests/devicefactory_test.py | 3 --- tests/devicelibs_test/dasd_test.py | 1 - tests/devicelibs_test/mdraid_test.py | 3 --- tests/devicelibs_test/raid_test.py | 2 +- tests/devices_test/dependencies_test.py | 3 --- tests/devices_test/device_names_test.py | 3 --- tests/devices_test/device_packages_test.py | 3 --- tests/devices_test/device_properties_test.py | 3 --- tests/devices_test/lvm_test.py | 3 --- tests/devices_test/network_test.py | 3 --- tests/devices_test/partition_test.py | 3 --- tests/devicetree_test.py | 2 -- tests/formats_test/device_test.py | 3 --- tests/formats_test/fs_test.py | 3 --- tests/formats_test/fslabeling.py | 1 - tests/formats_test/fstesting.py | 1 - tests/formats_test/init_test.py | 1 - tests/formats_test/labeling_test.py | 3 --- tests/formats_test/selinux_test.py | 3 --- tests/parentlist_test.py | 3 --- tests/partitioning_test.py | 3 --- tests/size_test.py | 3 --- tests/storagetestcase.py | 1 - tests/tsort_test.py | 2 -- tests/udev_test.py | 3 --- tests/util_test.py | 1 - 27 files changed, 1 insertion(+), 66 deletions(-) mode change 100755 => 100644 tests/devicelibs_test/mdraid_test.py mode change 100755 => 100644 tests/formats_test/device_test.py mode change 100755 => 100644 tests/formats_test/fs_test.py mode change 100755 => 100644 tests/formats_test/labeling_test.py mode change 100755 => 100644 tests/formats_test/selinux_test.py
diff --git a/tests/action_test.py b/tests/action_test.py index 69b2c86..ae247c3 100644 --- a/tests/action_test.py +++ b/tests/action_test.py @@ -1,4 +1,3 @@ -#!/usr/bin/python
import unittest
@@ -1163,6 +1162,3 @@ def testActionSorting(self, *args, **kwargs): """ Verify correct functioning of action sorting. """ pass
-if __name__ == "__main__": - unittest.main() - diff --git a/tests/devicefactory_test.py b/tests/devicefactory_test.py index 8ea43cb..1edb98a 100644 --- a/tests/devicefactory_test.py +++ b/tests/devicefactory_test.py @@ -1,4 +1,3 @@ -#!/usr/bin/python
import unittest
@@ -59,5 +58,3 @@ def testMDFactory(self):
self.assertIsNone(self.factory2.get_container())
-if __name__ == "__main__": - unittest.main() diff --git a/tests/devicelibs_test/dasd_test.py b/tests/devicelibs_test/dasd_test.py index 98f2cd1..49407a9 100644 --- a/tests/devicelibs_test/dasd_test.py +++ b/tests/devicelibs_test/dasd_test.py @@ -1,4 +1,3 @@ -#!/usr/bin/python import unittest
import blivet.devicelibs.dasd as dasd diff --git a/tests/devicelibs_test/mdraid_test.py b/tests/devicelibs_test/mdraid_test.py old mode 100755 new mode 100644 index 6408f03..8b6cd1c --- a/tests/devicelibs_test/mdraid_test.py +++ b/tests/devicelibs_test/mdraid_test.py @@ -1,4 +1,3 @@ -#!/usr/bin/python import unittest
import blivet.devicelibs.mdraid as mdraid @@ -17,5 +16,3 @@ def testMDRaid(self): self.assertEqual(mdraid.RAID_levels.raidLevel("RAID6").name, "raid6") self.assertEqual(mdraid.RAID_levels.raidLevel("raid10").name, "raid10")
-if __name__ == "__main__": - unittest.main() diff --git a/tests/devicelibs_test/raid_test.py b/tests/devicelibs_test/raid_test.py index ba1a580..4cc5652 100644 --- a/tests/devicelibs_test/raid_test.py +++ b/tests/devicelibs_test/raid_test.py @@ -1,4 +1,3 @@ -#!/usr/bin/python import unittest
import blivet.devicelibs.raid as raid @@ -154,3 +153,4 @@ def testRaid(self):
with self.assertRaisesRegexp(errors.RaidError, "invalid standard RAID level descriptor"): raid.RAIDLevels(["raid3.1415"]) + diff --git a/tests/devices_test/dependencies_test.py b/tests/devices_test/dependencies_test.py index 55ea3de..87d4141 100644 --- a/tests/devices_test/dependencies_test.py +++ b/tests/devices_test/dependencies_test.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim:set fileencoding=utf-8
import unittest @@ -86,5 +85,3 @@ def tearDown(self):
availability.CACHE_AVAILABILITY = self.cache_availability
-if __name__ == "__main__": - unittest.main() diff --git a/tests/devices_test/device_names_test.py b/tests/devices_test/device_names_test.py index f15f471..c1ee832 100644 --- a/tests/devices_test/device_names_test.py +++ b/tests/devices_test/device_names_test.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim:set fileencoding=utf-8
import unittest @@ -42,5 +41,3 @@ def testLogicalVolume(self): for name in bad_names: self.assertFalse(LVMLogicalVolumeDevice.isNameValid(name))
-if __name__ == "__main__": - unittest.main() diff --git a/tests/devices_test/device_packages_test.py b/tests/devices_test/device_packages_test.py index a3295f5..fce6078 100644 --- a/tests/devices_test/device_packages_test.py +++ b/tests/devices_test/device_packages_test.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim:set fileencoding=utf-8
import unittest @@ -30,5 +29,3 @@ def testPackages(self): for package in dev1.format.packages + dev2.format.packages + dev.format.packages: self.assertIn(package, packages)
-if __name__ == "__main__": - unittest.main() diff --git a/tests/devices_test/device_properties_test.py b/tests/devices_test/device_properties_test.py index 8330c2d..4bc8850 100644 --- a/tests/devices_test/device_properties_test.py +++ b/tests/devices_test/device_properties_test.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim:set fileencoding=utf-8
import unittest @@ -710,5 +709,3 @@ def testBTRFSSnapShotDeviceInit(self): self.assertEqual(snap.dependsOn(vol), True) self.assertEqual(vol.dependsOn(snap), False)
-if __name__ == "__main__": - unittest.main() diff --git a/tests/devices_test/lvm_test.py b/tests/devices_test/lvm_test.py index 72fbd83..bab4557 100644 --- a/tests/devices_test/lvm_test.py +++ b/tests/devices_test/lvm_test.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim:set fileencoding=utf-8
import unittest @@ -138,5 +137,3 @@ def testTargetSize(self): self.assertEqual(lv.targetSize, orig_size) self.assertEqual(lv.size, orig_size)
-if __name__ == "__main__": - unittest.main() diff --git a/tests/devices_test/network_test.py b/tests/devices_test/network_test.py index 8a954fc..b1a81b6 100644 --- a/tests/devices_test/network_test.py +++ b/tests/devices_test/network_test.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim:set fileencoding=utf-8
import unittest @@ -36,5 +35,3 @@ def testNetDevUpdate(self):
self.assertTrue("_netdev" in dev.format.options.split(","))
-if __name__ == "__main__": - unittest.main() diff --git a/tests/devices_test/partition_test.py b/tests/devices_test/partition_test.py index b4fef6c..afa9f05 100644 --- a/tests/devices_test/partition_test.py +++ b/tests/devices_test/partition_test.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim:set fileencoding=utf-8
import os @@ -156,5 +155,3 @@ def testMinMaxSizeAlignment(self): disk.format.endAlignment.isAligned(free, max_end_sector), True)
-if __name__ == "__main__": - unittest.main() diff --git a/tests/devicetree_test.py b/tests/devicetree_test.py index 906fe7a..10d6e18 100644 --- a/tests/devicetree_test.py +++ b/tests/devicetree_test.py @@ -279,5 +279,3 @@ def _set_up_storage(self): disks=self.blivet.disks[:], container_raid_level="raid1")
-if __name__ == "__main__": - unittest.main() diff --git a/tests/formats_test/device_test.py b/tests/formats_test/device_test.py old mode 100755 new mode 100644 index 588cb97..197be02 --- a/tests/formats_test/device_test.py +++ b/tests/formats_test/device_test.py @@ -1,4 +1,3 @@ -#!/usr/bin/python import unittest
import blivet @@ -79,5 +78,3 @@ def testValue(self): self.assertEqual(an_fs.type, typ) self.assertEqual(an_fs.device, "/abc:/def")
-if __name__ == "__main__": - unittest.main() diff --git a/tests/formats_test/fs_test.py b/tests/formats_test/fs_test.py old mode 100755 new mode 100644 index 71fa524..2952320 --- a/tests/formats_test/fs_test.py +++ b/tests/formats_test/fs_test.py @@ -1,4 +1,3 @@ -#!/usr/bin/python import os import tempfile import unittest @@ -140,5 +139,3 @@ def tearDown(self): pass os.rmdir(self.mountpoint)
-if __name__ == "__main__": - unittest.main() diff --git a/tests/formats_test/fslabeling.py b/tests/formats_test/fslabeling.py index 200cffe..fc63210 100644 --- a/tests/formats_test/fslabeling.py +++ b/tests/formats_test/fslabeling.py @@ -1,4 +1,3 @@ -#!/usr/bin/python
import abc from six import add_metaclass diff --git a/tests/formats_test/fstesting.py b/tests/formats_test/fstesting.py index dad6e3f..377ebff 100644 --- a/tests/formats_test/fstesting.py +++ b/tests/formats_test/fstesting.py @@ -1,4 +1,3 @@ -#!/usr/bin/python
import abc from six import add_metaclass diff --git a/tests/formats_test/init_test.py b/tests/formats_test/init_test.py index 6fc11c6..d877094 100644 --- a/tests/formats_test/init_test.py +++ b/tests/formats_test/init_test.py @@ -1,4 +1,3 @@ -#!/usr/bin/python import copy import unittest
diff --git a/tests/formats_test/labeling_test.py b/tests/formats_test/labeling_test.py old mode 100755 new mode 100644 index 4f69e81..c96a577 --- a/tests/formats_test/labeling_test.py +++ b/tests/formats_test/labeling_test.py @@ -1,4 +1,3 @@ -#!/usr/bin/python import unittest
from tests import loopbackedtestcase @@ -138,5 +137,3 @@ def testCreatingSwapSpaceEmpty(self): swp = swap.SwapSpace(device=self.loopDevices[0], label="") self.assertIsNone(swp.create())
-if __name__ == "__main__": - unittest.main() diff --git a/tests/formats_test/selinux_test.py b/tests/formats_test/selinux_test.py old mode 100755 new mode 100644 index b5c62eb..d1dddc7 --- a/tests/formats_test/selinux_test.py +++ b/tests/formats_test/selinux_test.py @@ -1,4 +1,3 @@ -#!/usr/bin/python import os import selinux import tempfile @@ -95,5 +94,3 @@ def tearDown(self): super(SELinuxContextTestCase, self).tearDown() blivet.flags.installer_mode = self.installer_mode
-if __name__ == "__main__": - unittest.main() diff --git a/tests/parentlist_test.py b/tests/parentlist_test.py index bce13a0..6ee8382 100644 --- a/tests/parentlist_test.py +++ b/tests/parentlist_test.py @@ -82,6 +82,3 @@ def suite(): return unittest.TestLoader().loadTestsFromTestCase(ParentListTestCase)
-if __name__ == "__main__": - unittest.main() - diff --git a/tests/partitioning_test.py b/tests/partitioning_test.py index 0a301bc..bb54dd4 100644 --- a/tests/partitioning_test.py +++ b/tests/partitioning_test.py @@ -1,4 +1,3 @@ -#!/usr/bin/python
import unittest from mock import Mock @@ -587,5 +586,3 @@ def testExplicitExtendedPartitions(self):
self.blivet.doIt()
-if __name__ == "__main__": - unittest.main() diff --git a/tests/size_test.py b/tests/size_test.py index 9416d71..9004812 100644 --- a/tests/size_test.py +++ b/tests/size_test.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # pylint: disable=environment-modify # # tests/storage/size_tests.py @@ -399,5 +398,3 @@ def testArithmetic(self): self.assertIsInstance(2**Size(2), Decimal) self.assertIsInstance(1024 % Size(127), Decimal)
-if __name__ == "__main__": - unittest.main() diff --git a/tests/storagetestcase.py b/tests/storagetestcase.py index ad1216f..7ac48d3 100644 --- a/tests/storagetestcase.py +++ b/tests/storagetestcase.py @@ -1,4 +1,3 @@ -#!/usr/bin/python
import unittest from mock import Mock diff --git a/tests/tsort_test.py b/tests/tsort_test.py index 640becd..6a1f24f 100644 --- a/tests/tsort_test.py +++ b/tests/tsort_test.py @@ -52,5 +52,3 @@ def check_order(order, graph): self.failUnless(check_order(order, graph), "ordering constraints not satisfied")
-if __name__ == "__main__": - unittest.main() diff --git a/tests/udev_test.py b/tests/udev_test.py index e3e817d..8e0fbb2 100644 --- a/tests/udev_test.py +++ b/tests/udev_test.py @@ -1,4 +1,3 @@ -#!/usr/bin/python
import unittest import mock @@ -37,5 +36,3 @@ def udev_trigger_test(self): self.assertTrue(blivet.udev.util.run_program.called)
-if __name__ == "__main__": - unittest.main() diff --git a/tests/util_test.py b/tests/util_test.py index fe7a841..410dc0c 100644 --- a/tests/util_test.py +++ b/tests/util_test.py @@ -1,4 +1,3 @@ -#!/usr/bin/python
import unittest from decimal import Decimal
I'm assuming you got them all, ACK.
Added label: ACK.
The commit message shouldn't end with ';' and it should be updated to better describe the current set of changes.
anaconda-patches@lists.fedorahosted.org