1
Description: Remove dependency on unittest2 for the tests
2
Origin: commit, revision id: git-v1:82e8cc3c426995d5bfeb110b77a4ccc983a88ff4
3
Author: Florent Xicluna <florent.xicluna@gmail.com>
4
Last-Update: 2013-06-18
5
X-Bzr-Revision-Id: git-v1:82e8cc3c426995d5bfeb110b77a4ccc983a88ff4
7
=== modified file 'NEWS.txt'
8
--- old/NEWS.txt 2013-04-24 12:29:08 +0000
9
+++ new/NEWS.txt 2013-06-18 22:51:28 +0000
12
+ - Remove dependency on Unittest2 for the tests (for Python >= 2.7).
15
- Fix computation of `DoctestSyntaxError.lineno` and `col`.
16
- Add boolean attribute `Checker.withDoctest` to ignore doctests.
18
=== modified file 'pyflakes/test/__init__.py'
19
--- old/pyflakes/test/__init__.py 2005-12-31 02:20:44 +0000
20
+++ new/pyflakes/test/__init__.py 2013-06-18 22:51:28 +0000
23
+if sys.version_info < (2, 7):
24
+ # Python 2.6 ships an obsolete version of "unittest"
25
+ sys.modules['unittest'] = __import__('unittest2')
27
=== modified file 'pyflakes/test/harness.py'
28
--- old/pyflakes/test/harness.py 2013-01-19 17:13:22 +0000
29
+++ new/pyflakes/test/harness.py 2013-06-18 22:51:28 +0000
37
from pyflakes import checker
40
-class Test(unittest2.TestCase):
41
+class Test(unittest.TestCase):
43
def flakes(self, input, *expectedOutputs, **kw):
44
ast = compile(textwrap.dedent(input), "<test>", "exec",
46
=== modified file 'pyflakes/test/test_api.py'
47
--- old/pyflakes/test/test_api.py 2013-04-24 21:51:36 +0000
48
+++ new/pyflakes/test/test_api.py 2013-06-18 22:51:28 +0000
53
-from unittest2 import skipIf, TestCase
54
+from unittest import skipIf, TestCase
56
from pyflakes.messages import UnusedImport
57
from pyflakes.reporter import Reporter
59
=== modified file 'pyflakes/test/test_doctests.py'
60
--- old/pyflakes/test/test_doctests.py 2013-04-24 11:55:59 +0000
61
+++ new/pyflakes/test/test_doctests.py 2013-06-18 22:51:28 +0000
64
-from unittest2 import skip
65
+from unittest import skip
67
from pyflakes.test.test_other import Test as TestOther
68
from pyflakes.test.test_imports import Test as TestImports
70
=== modified file 'pyflakes/test/test_imports.py'
71
--- old/pyflakes/test/test_imports.py 2013-04-21 15:32:22 +0000
72
+++ new/pyflakes/test/test_imports.py 2013-06-18 22:51:28 +0000
75
from sys import version_info
76
-from unittest2 import skip, skipIf
77
+from unittest import skip, skipIf
79
from pyflakes import messages as m
80
from pyflakes.test import harness
82
=== modified file 'pyflakes/test/test_other.py'
83
--- old/pyflakes/test/test_other.py 2013-04-21 15:32:22 +0000
84
+++ new/pyflakes/test/test_other.py 2013-06-18 22:51:28 +0000
88
from sys import version_info
89
-from unittest2 import skip, skipIf
90
+from unittest import skip, skipIf
92
from pyflakes import messages as m
93
from pyflakes.test import harness
95
=== modified file 'pyflakes/test/test_undefined_names.py'
96
--- old/pyflakes/test/test_undefined_names.py 2013-04-21 15:32:22 +0000
97
+++ new/pyflakes/test/test_undefined_names.py 2013-06-18 22:51:28 +0000
99
from _ast import PyCF_ONLY_AST
100
from sys import version_info
102
-from unittest2 import skip, skipIf, TestCase
103
+from unittest import skip, skipIf, TestCase
105
from pyflakes import messages as m, checker
106
from pyflakes.test import harness
108
=== modified file 'setup.py'
109
--- old/setup.py 2013-03-31 12:44:47 +0000
110
+++ new/setup.py 2013-06-18 22:51:28 +0000
112
from distutils.core import setup
113
extra = {'scripts': ["bin/pyflakes"]}
115
- if sys.version_info < (3,):
116
- extra = {'tests_require': ['unittest2'],
117
- 'test_suite': 'unittest2.collector'}
119
- extra = {'tests_require': ['unittest2py3k'],
120
- 'test_suite': 'unittest2.collector.collector'}
121
- extra['entry_points'] = {
122
- 'console_scripts': ['pyflakes = pyflakes.api:main'],
124
+ 'test_suite': 'pyflakes.test',
126
+ 'console_scripts': ['pyflakes = pyflakes.api:main'],
129
+ if sys.version_info < (2, 7):
130
+ extra['tests_require'] = ['unittest2']
133
def get_version(fname=os.path.join('pyflakes', '__init__.py')):