File: python-unittest2.patch

package info (click to toggle)
python-launchpadlib 1.10.2%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 544 kB
  • ctags: 637
  • sloc: python: 2,099; makefile: 27; sh: 9
file content (50 lines) | stat: -rw-r--r-- 1,181 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Description: Use unittest2 if available.
 The launchpadlib test suite takes advantages of new features in unittest in
 Python 2.7.
 Use the unittest2 backport-module on <2.7.
Author: Stefano Rivera <stefanor@debian.org>
Forwarded: no
Last-Update: 2012-05-03

--- a/src/launchpadlib/tests/test_credential_store.py
+++ b/src/launchpadlib/tests/test_credential_store.py
@@ -18,7 +18,10 @@
 
 import os
 import tempfile
-import unittest
+try:
+    import unittest2 as unittest
+except ImportError:
+    import unittest
 
 from base64 import b64decode
 
--- a/src/launchpadlib/tests/test_http.py
+++ b/src/launchpadlib/tests/test_http.py
@@ -18,7 +18,10 @@
 
 from collections import deque
 import tempfile
-import unittest
+try:
+    import unittest2 as unittest
+except ImportError:
+    import unittest
 
 from simplejson import dumps, JSONDecodeError
 
--- a/src/launchpadlib/tests/test_launchpad.py
+++ b/src/launchpadlib/tests/test_launchpad.py
@@ -24,7 +24,10 @@
 import socket
 import stat
 import tempfile
-import unittest
+try:
+    import unittest2 as unittest
+except ImportError:
+    import unittest
 import warnings
 
 from lazr.restfulclient.resource import ServiceRoot