@@ -929,7 +929,7 @@ def test_several_leapyears_in_range(self):
929929
930930
931931def conv (s ):
932- return s .replace ( ' \n ' , os . linesep ). encode ()
932+ return s .encode ()
933933
934934class CommandLineTestCase (unittest .TestCase ):
935935 def setUp (self ):
@@ -1035,7 +1035,6 @@ def test_option_encoding(self):
10351035 def test_option_locale (self ):
10361036 self .assertFailure ('-L' )
10371037 self .assertFailure ('--locale' )
1038- self .assertFailure ('-L' , 'en' )
10391038
10401039 lang , enc = locale .getlocale ()
10411040 lang = lang or 'C'
@@ -1069,7 +1068,7 @@ def test_option_lines(self):
10691068 self .assertFailure ('-l' , 'spam' )
10701069 for run in self .runners :
10711070 output = run ('--lines' , '2' , '2004' )
1072- self .assertIn ( conv ( 'December\n \n Mo Tu We' ), output )
1071+ self .assertRegex ( output , br 'December(\r\n|\n){2}Mo Tu We' )
10731072
10741073 def test_option_spacing (self ):
10751074 self .assertFailure ('-s' )
@@ -1085,7 +1084,7 @@ def test_option_months(self):
10851084 self .assertFailure ('-m' , 'spam' )
10861085 for run in self .runners :
10871086 output = run ('--months' , '1' , '2004' )
1088- self .assertIn ( conv ( ' \n Mo Tu We Th Fr Sa Su\n ' ), output )
1087+ self .assertRegex ( output , br'(\r\n|\n)Mo Tu We Th Fr Sa Su(\r\n|\n)' )
10891088
10901089 def test_option_type (self ):
10911090 self .assertFailure ('-t' )
0 commit comments