1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
Description: Fix test failure caused by changes in Python 3.3
Author: Benjamin Drung <benjamin.drung@profitbricks.com>
--- a/versiontools/tests.py
+++ b/versiontools/tests.py
@@ -134,8 +134,12 @@
except Exception:
e = sys.exc_info()[1]
self.assertTrue(isinstance(e, DistutilsSetupError))
- self.assertEqual(str(e), "Unable to import 'nonexisting': "
- "No module named nonexisting")
+ if sys.version_info[:2] >= (3, 3):
+ error_msg = "No module named 'nonexisting'"
+ else:
+ error_msg = "No module named nonexisting"
+ self.assertEqual(str(e), "Unable to import 'nonexisting': " +
+ error_msg)
def test_not_found(self):
version = ':versiontools:versiontools:__nonexisting__'
|