Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2560280

Browse files
committed
Fix xargs.partition tests: explicity set unicode chars
1 parent 333ea75 commit 2560280

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/xargs_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def test_partition_limits():
5555

5656
def test_partition_limit_win32(sys_win32_mock):
5757
cmd = ('ninechars',)
58-
varargs = ('😑' * 10,)
58+
varargs = (u'😑' * 10,)
5959
with mock.patch('pre_commit.xargs.sys', sys_win32_mock):
6060
ret = xargs.partition(cmd, varargs, _max_length=20)
6161

@@ -64,7 +64,7 @@ def test_partition_limit_win32(sys_win32_mock):
6464

6565
def test_partition_limit_linux(sys_linux_mock):
6666
cmd = ('ninechars',)
67-
varargs = ('😑' * 5,)
67+
varargs = (u'😑' * 5,)
6868
with mock.patch('pre_commit.xargs.sys', sys_linux_mock):
6969
ret = xargs.partition(cmd, varargs, _max_length=30)
7070

@@ -73,7 +73,7 @@ def test_partition_limit_linux(sys_linux_mock):
7373

7474
def test_argument_too_long_with_large_unicode(sys_linux_mock):
7575
cmd = ('ninechars',)
76-
varargs = ('😑' * 10,) # 4 bytes * 10
76+
varargs = (u'😑' * 10,) # 4 bytes * 10
7777
with mock.patch('pre_commit.xargs.sys', sys_linux_mock):
7878
with pytest.raises(xargs.ArgumentTooLongError):
7979
xargs.partition(cmd, varargs, _max_length=20)

0 commit comments

Comments
 (0)