File: fix-python-3.3-test.patch

package info (click to toggle)
versiontools 1.9.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 208 kB
  • sloc: python: 466; makefile: 5
file content (20 lines) | stat: -rw-r--r-- 876 bytes parent folder | download | duplicates (4)
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__'