Skip to content

Commit 424b0ee

Browse files
committed
Make all tests pass on py3.4
1 parent 5e3e55c commit 424b0ee

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

djclick/test/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def test_project():
5151
def manage():
5252
def call(*args):
5353
cmd = [
54+
sys.executable,
5455
os.path.join(os.path.dirname(__file__), 'testprj', 'manage.py'),
5556
] + list(args)
5657
return subprocess.check_output(cmd)

djclick/test/test_adapter.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818

1919
@pytest.mark.skipif(not six.PY3, reason='Only necessary on Python3')
2020
def test_not_ascii():
21-
"""Make sure that the systems preferred encoding is not `ascii`.
21+
"""
22+
Make sure that the systems preferred encoding is not `ascii`.
2223
2324
Otherwise `click` is raising a RuntimeError for Python3. For a detailed
2425
description of this very problem please consult the following gist:
@@ -95,15 +96,14 @@ def test_django_traceback():
9596
assert False
9697

9798

98-
@pytest.mark.xfail(six.PY3, reason='Encoding issues')
9999
def test_django_settings(manage):
100100
# The --settings switch only works from the command line (or if the django
101101
# settings where not setup before... this means that we have to call it
102102
# in a subprocess.
103103
cmd = 'settingscmd'
104-
assert manage(cmd) == 'default'
105-
assert manage(cmd, '--settings', 'testprj.settings') == 'default'
106-
assert manage(cmd, '--settings', 'testprj.settings_alt') == 'alternative'
104+
assert manage(cmd) == b'default'
105+
assert manage(cmd, '--settings', 'testprj.settings') == b'default'
106+
assert manage(cmd, '--settings', 'testprj.settings_alt') == b'alternative'
107107

108108

109109
def test_django_color(capsys):
@@ -126,7 +126,6 @@ def test_django_color(capsys):
126126
assert err == 'stderr'
127127

128128

129-
@pytest.mark.xfail(six.PY3, reason='Encoding issues')
130129
def test_django_help(manage):
131130
# The -h/--help switches cause the program to exit. Invoking the command
132131
# through execute_from_command_line would cause the test suit to exit as
@@ -139,8 +138,8 @@ def test_django_help(manage):
139138
assert len(set(helps)) == 1
140139

141140
help_text = helps[0]
142-
assert 'HELP_CALLED' not in help_text
143-
assert help_text.startswith('Usage: manage.py helpcmd ')
141+
assert b'HELP_CALLED' not in help_text
142+
assert help_text.startswith(b'Usage: manage.py helpcmd ')
144143

145144

146145
@todo

0 commit comments

Comments
 (0)