@@ -275,7 +275,7 @@ def __get_msg(fun):
275
275
def _run_check (self , code , checker , filename = None ):
276
276
pep8 .register_check (checker )
277
277
278
- lines = textwrap .dedent (code ).strip ().splitlines (True )
278
+ lines = textwrap .dedent (code ).lstrip ().splitlines (True )
279
279
280
280
checker = pep8 .Checker (filename = filename , lines = lines )
281
281
# NOTE(sdague): the standard reporter has printing to stdout
@@ -580,12 +580,14 @@ def test_check_config_option_in_central_place(self):
580
580
def test_check_doubled_words (self ):
581
581
errors = [(1 , 0 , "N343" )]
582
582
583
- # Artificial break to stop pep8 detecting the test !
584
- code = "This is the" + " the best comment"
583
+ # Explicit addition of line-ending here and below since this isn't a
584
+ # block comment and without it we trigger #1804062. Artificial break is
585
+ # necessary to stop flake8 detecting the test
586
+ code = "'This is the" + " the best comment'\n "
585
587
self ._assert_has_errors (code , checks .check_doubled_words ,
586
588
expected_errors = errors )
587
589
588
- code = "This is the then best comment"
590
+ code = "' This is the then best comment' \n "
589
591
self ._assert_has_no_errors (code , checks .check_doubled_words )
590
592
591
593
def test_dict_iteritems (self ):
0 commit comments