File: python3.2_tests.patch

package info (click to toggle)
python-mock 0.8.0-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,828 kB
  • sloc: python: 5,176; makefile: 50
file content (29 lines) | stat: -rw-r--r-- 680 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
Description: Allow tests to be run with python3 (>= 3.2).
Author: Michael Fladischer <FladischerMichael@fladi.at>
Last-Update: 2012-05-30
Forwarded: no

--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@
 from mock import __version__
 
 import os
-
+import sys
 
 NAME = 'mock'
 MODULES = ['mock']
@@ -66,7 +66,10 @@
 except ImportError:
     from distutils.core import setup
 else:
-    params['tests_require'] = ['unittest2']
-    params['test_suite'] = 'unittest2.collector'
+    if sys.version_info >= (3,):
+        params['test_suite'] = 'tests'
+    else:
+        params['tests_require'] = ['unittest2']
+        params['test_suite'] = 'unittest2.collector'
 
 setup(**params)