Merge lp:~dobey/dirspec/no-twisted into lp:dirspec

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 10
Merged at revision: 9
Proposed branch: lp:~dobey/dirspec/no-twisted
Merge into: lp:dirspec
Diff against target: 120 lines (+17/-16)
4 files modified
dirspec/tests/__init__.py (+1/-1)
dirspec/tests/test_utils.py (+9/-11)
run-tests (+5/-3)
setup.py (+2/-1)
To merge this branch: bzr merge lp:~dobey/dirspec/no-twisted
Reviewer Review Type Date Requested Status
Brian Curtin (community) Approve
Roberto Alsina (community) code review Approve
Review via email: mp+114695@code.launchpad.net

Commit message

Stop using twisted trial as the test runner and as the base test case
Use setuptools test runner support to run the tests
Use testtools.testcase as the base test case

To post a comment you must log in.
Revision history for this message
Roberto Alsina (ralsina) :
review: Approve (code review)
Revision history for this message
Brian Curtin (brian.curtin) :
review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (6.9 KiB)

The attempt to merge lp:~dobey/dirspec/no-twisted into lp:dirspec failed. Below is the output from the failed tests.

running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/dirspec
copying dirspec/basedir.py -> build/lib.linux-x86_64-2.7/dirspec
copying dirspec/__init__.py -> build/lib.linux-x86_64-2.7/dirspec
copying dirspec/utils.py -> build/lib.linux-x86_64-2.7/dirspec
running test
running egg_info
creating dirspec.egg-info
writing dirspec.egg-info/PKG-INFO
writing top-level names to dirspec.egg-info/top_level.txt
writing dependency_links to dirspec.egg-info/dependency_links.txt
writing manifest file 'dirspec.egg-info/SOURCES.txt'
reading manifest file 'dirspec.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'dirspec.egg-info/SOURCES.txt'
running build_ext

+ python ./setup.py build test clean
test_cache_home (dirspec.tests.test_basedir.BasedirTestCase)
dirspec.tests.test_basedir.BasedirTestCase.test_cache_home ... ok
test_config_dirs (dirspec.tests.test_basedir.BasedirTestCase)
dirspec.tests.test_basedir.BasedirTestCase.test_config_dirs ... ok
test_config_home (dirspec.tests.test_basedir.BasedirTestCase)
dirspec.tests.test_basedir.BasedirTestCase.test_config_home ... ok
test_data_dirs (dirspec.tests.test_basedir.BasedirTestCase)
dirspec.tests.test_basedir.BasedirTestCase.test_data_dirs ... ok
test_data_home (dirspec.tests.test_basedir.BasedirTestCase)
dirspec.tests.test_basedir.BasedirTestCase.test_data_home ... ok
test_default_cache_home (dirspec.tests.test_basedir.BasedirTestCase)
dirspec.tests.test_basedir.BasedirTestCase.test_default_cache_home ... ok
test_default_config_dirs (dirspec.tests.test_basedir.BasedirTestCase)
dirspec.tests.test_basedir.BasedirTestCase.test_default_config_dirs ... ok
test_default_config_home (dirspec.tests.test_basedir.BasedirTestCase)
dirspec.tests.test_basedir.BasedirTestCase.test_default_config_home ... ok
test_default_data_dirs (dirspec.tests.test_basedir.BasedirTestCase)
dirspec.tests.test_basedir.BasedirTestCase.test_default_data_dirs ... ok
test_default_data_home (dirspec.tests.test_basedir.BasedirTestCase)
dirspec.tests.test_basedir.BasedirTestCase.test_default_data_home ... ok
test_load_config_paths_filter (dirspec.tests.test_basedir.BasedirTestCase)
dirspec.tests.test_basedir.BasedirTestCase.test_load_config_paths_filter ... ok
test_save_config_path (dirspec.tests.test_basedir.BasedirTestCase)
dirspec.tests.test_basedir.BasedirTestCase.test_save_config_path ... ok
test_xdg_cache_home_is_utf8_bytes (dirspec.tests.test_basedir.BasedirTestCase)
dirspec.tests.test_basedir.BasedirTestCase.test_xdg_cache_home_is_utf8_bytes ... ok
test_xdg_config_dirs_are_bytes (dirspec.tests.test_basedir.BasedirTestCase)
dirspec.tests.test_basedir.BasedirTestCase.test_xdg_config_dirs_are_bytes ... ok
test_xdg_config_home_is_utf8_bytes (dirspec.tests.test_basedir.BasedirTestCase)
dirspec.tests.test_basedir.BasedirTestCase.test_xdg_config_home_is_utf8_bytes ... ok
test_xdg_data_dirs_are_bytes (dirspec.tests.test_basedir.BasedirTestCase)
dirspec.tests.test_basedir.BasedirTestCase.test_xdg_data_dirs_are_bytes ... ok
test_xdg_da...

Read more...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dirspec/tests/__init__.py'
2--- dirspec/tests/__init__.py 2011-12-17 00:46:26 +0000
3+++ dirspec/tests/__init__.py 2012-07-12 19:13:36 +0000
4@@ -15,7 +15,7 @@
5 # along with this program. If not, see <http://www.gnu.org/licenses/>.
6 """"dirspec tests."""
7
8-from twisted.trial.unittest import TestCase
9+from testtools.testcase import TestCase
10
11
12 class BaseTestCase(TestCase):
13
14=== modified file 'dirspec/tests/test_utils.py'
15--- dirspec/tests/test_utils.py 2012-07-11 14:55:08 +0000
16+++ dirspec/tests/test_utils.py 2012-07-12 19:13:36 +0000
17@@ -17,12 +17,11 @@
18 import os
19 import sys
20
21-from twisted.trial.unittest import TestCase
22-
23 from dirspec import basedir, utils as dirutils
24 from dirspec.utils import (get_env_path, get_special_folders,
25 user_home, get_program_path)
26 from dirspec.tests import BaseTestCase
27+from testtools.testcase import skip
28
29
30 class UtilsTestCase(BaseTestCase):
31@@ -66,6 +65,9 @@
32
33 def test_get_special_folders(self):
34 """Make sure we can import the platform module."""
35+ if sys.platform != 'win32':
36+ self.skipTest('Win32 is required for this test.')
37+
38 import win32com.shell
39 shell_module = FakeShellModule()
40 self.patch(win32com.shell, "shell", shell_module)
41@@ -91,10 +93,6 @@
42 for val in special_folders.itervalues():
43 self.assertIsInstance(val, str)
44 val.decode('utf8')
45- # Should not raise exceptions
46-
47- if sys.platform != 'win32':
48- test_get_special_folders.skip = 'Only works on Win32'
49
50 def test_get_data_dirs(self):
51 """Check thet get_data_dirs uses pathsep correctly."""
52@@ -132,6 +130,7 @@
53 self.addCleanup(os.environ.__setitem__, key, current_value)
54 del(os.environ[key])
55
56+ @skip('UnicodeEncodeError: bug #907053')
57 def test_get_env_path_var(self):
58 """Test that get_env_path transforms an env var."""
59 fake_path = u"C:\\Users\\Ñandú"
60@@ -143,6 +142,7 @@
61 self.set_fake_environ(fake_env_var, mbcs_path)
62 self.assertEqual(get_env_path(fake_env_var, "unexpected"), utf8_path)
63
64+ @skip('UnicodeEncodeError: bug #907053')
65 def test_get_env_path_no_var(self):
66 """Test that get_env_path returns the default when env var not set."""
67 fake_path = u"C:\\Users\\Ñandú"
68@@ -151,11 +151,9 @@
69
70 self.unset_fake_environ(fake_env_var)
71 self.assertEqual(get_env_path(fake_env_var, default), default)
72- test_get_env_path_var.skip = 'UnicodeEncodeError: bug #907053'
73- test_get_env_path_no_var.skip = test_get_env_path_var.skip
74-
75-
76-class ProgramPathBaseTestCase(TestCase):
77+
78+
79+class ProgramPathBaseTestCase(BaseTestCase):
80 """Base class for testing the executable finder."""
81
82 def setUp(self):
83
84=== modified file 'run-tests'
85--- run-tests 2012-07-06 19:04:34 +0000
86+++ run-tests 2012-07-12 19:13:36 +0000
87@@ -15,9 +15,11 @@
88 # along with this program. If not, see <http://www.gnu.org/licenses/>.
89
90 set -e -x
91-trial dirspec
92+
93+# Run the tests
94+python ./setup.py build test clean
95+
96+# Run the style checks
97 pyflakes dirspec setup.py
98 pep8 --repeat . setup.py
99-rm -rf _trial_temp
100-rm -f .coverage
101
102
103=== modified file 'setup.py'
104--- setup.py 2012-05-24 17:55:14 +0000
105+++ setup.py 2012-07-12 19:13:36 +0000
106@@ -15,7 +15,7 @@
107 # You should have received a copy of the GNU Lesser General Public License
108 # along with this program. If not, see <http://www.gnu.org/licenses/>.
109 """Setup and install dirspec."""
110-from distutils.core import setup
111+from setuptools import setup
112
113 setup(
114 name='dirspec',
115@@ -23,4 +23,5 @@
116 packages=['dirspec'],
117 description='XDG Base and User directories implementation',
118 url='https://launchpad.net/dirspec',
119+ test_suite='dirspec.tests',
120 )

Subscribers

People subscribed via source and target branches

to all changes: