##// END OF EJS Templates
utils/tests: move to pytest.mark.parameterize in test_process.py
Nate Rush -
Show More
@@ -56,34 +56,32 b' def test_find_cmd_fail():'
56 pytest.raises(FindCmdError, find_cmd, "asdfasdf")
56 pytest.raises(FindCmdError, find_cmd, "asdfasdf")
57
57
58
58
59 # TODO: move to pytest.mark.parametrize once nose gone
60 @dec.skip_win32
59 @dec.skip_win32
61 def test_arg_split():
60 @pytest.mark.parametrize('argstr, argv', [
62 """Ensure that argument lines are correctly split like in a shell."""
61 ('hi', ['hi']),
63 tests = [['hi', ['hi']],
62 (u'hi', [u'hi']),
64 [u'hi', [u'hi']],
63 ('hello there', ['hello', 'there']),
65 ['hello there', ['hello', 'there']],
66 # \u01ce == \N{LATIN SMALL LETTER A WITH CARON}
64 # \u01ce == \N{LATIN SMALL LETTER A WITH CARON}
67 # Do not use \N because the tests crash with syntax error in
65 # Do not use \N because the tests crash with syntax error in
68 # some cases, for example windows python2.6.
66 # some cases, for example windows python2.6.
69 [u'h\u01cello', [u'h\u01cello']],
67 (u'h\u01cello', [u'h\u01cello']),
70 ['something "with quotes"', ['something', '"with quotes"']],
68 ('something "with quotes"', ['something', '"with quotes"']),
71 ]
69 ])
72 for argstr, argv in tests:
70 def test_arg_split(argstr, argv):
71 """Ensure that argument lines are correctly split like in a shell."""
73 assert arg_split(argstr) == argv
72 assert arg_split(argstr) == argv
74
73
75
74
76 # TODO: move to pytest.mark.parametrize once nose gone
77 @dec.skip_if_not_win32
75 @dec.skip_if_not_win32
78 def test_arg_split_win32():
76 @pytest.mark.parametrize('argstr,argv', [
77 ('hi', ['hi']),
78 (u'hi', [u'hi']),
79 ('hello there', ['hello', 'there']),
80 (u'h\u01cello', [u'h\u01cello']),
81 ('something "with quotes"', ['something', 'with quotes']),
82 ])
83 def test_arg_split_win32(argstr, argv):
79 """Ensure that argument lines are correctly split like in a shell."""
84 """Ensure that argument lines are correctly split like in a shell."""
80 tests = [['hi', ['hi']],
81 [u'hi', [u'hi']],
82 ['hello there', ['hello', 'there']],
83 [u'h\u01cello', [u'h\u01cello']],
84 ['something "with quotes"', ['something', 'with quotes']],
85 ]
86 for argstr, argv in tests:
87 assert arg_split(argstr) == argv
85 assert arg_split(argstr) == argv
88
86
89
87
General Comments 0
You need to be logged in to leave comments. Login now