@@ -56,35 +56,33 @@ def test_find_cmd_fail():
5656 pytest .raises (FindCmdError , find_cmd , "asdfasdf" )
5757
5858
59- # TODO: move to pytest.mark.parametrize once nose gone
6059@dec .skip_win32
61- def test_arg_split ():
60+ @pytest .mark .parametrize ('argstr, argv' , [
61+ ('hi' , ['hi' ]),
62+ (u'hi' , [u'hi' ]),
63+ ('hello there' , ['hello' , 'there' ]),
64+ # \u01ce == \N{LATIN SMALL LETTER A WITH CARON}
65+ # Do not use \N because the tests crash with syntax error in
66+ # some cases, for example windows python2.6.
67+ (u'h\u01ce llo' , [u'h\u01ce llo' ]),
68+ ('something "with quotes"' , ['something' , '"with quotes"' ]),
69+ ])
70+ def test_arg_split (argstr , argv ):
6271 """Ensure that argument lines are correctly split like in a shell."""
63- tests = [['hi' , ['hi' ]],
64- [u'hi' , [u'hi' ]],
65- ['hello there' , ['hello' , 'there' ]],
66- # \u01ce == \N{LATIN SMALL LETTER A WITH CARON}
67- # Do not use \N because the tests crash with syntax error in
68- # some cases, for example windows python2.6.
69- [u'h\u01ce llo' , [u'h\u01ce llo' ]],
70- ['something "with quotes"' , ['something' , '"with quotes"' ]],
71- ]
72- for argstr , argv in tests :
73- assert arg_split (argstr ) == argv
74-
75-
76- # TODO: move to pytest.mark.parametrize once nose gone
72+ assert arg_split (argstr ) == argv
73+
74+
7775@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\u01ce llo' , [u'h\u01ce llo' ]),
81+ ('something "with quotes"' , ['something' , 'with quotes' ]),
82+ ])
83+ def test_arg_split_win32 (argstr , argv ):
7984 """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\u01ce llo' , [u'h\u01ce llo' ]],
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
8886
8987
9088class SubProcessTestCase (tt .TempFileMixin ):
0 commit comments