Bug 75197 - Add unittests for the Python parser of prepare-ChangeLog
Summary: Add unittests for the Python parser of prepare-ChangeLog
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kentaro Hara
URL:
Keywords:
Depends on:
Blocks: 73531
  Show dependency treegraph
 
Reported: 2011-12-24 12:04 PST by Kentaro Hara
Modified: 2011-12-25 00:10 PST (History)
4 users (show)

See Also:


Attachments
Patch (5.37 KB, patch)
2011-12-24 12:28 PST, Kentaro Hara
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kentaro Hara 2011-12-24 12:04:19 PST
We should add unittests for the Python parser (i.e. get_function_line_ranges_for_python()) of prepare-ChangeLog.
Comment 1 Kentaro Hara 2011-12-24 12:28:38 PST
Created attachment 120502 [details]
Patch
Comment 2 WebKit Review Bot 2011-12-24 12:31:46 PST
Attachment 120502 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Tools/ChangeLog', u'Tools/Scripts/prepare-..." exit_code: 1

Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/python_unittests.py:1:  missing whitespace around operator  [pep8/E225] [5]
Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/python_unittests.py:2:  indentation is not a multiple of four  [pep8/E111] [5]
Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/python_unittests.py:2:  missing whitespace around operator  [pep8/E225] [5]
Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/python_unittests.py:2:  whitespace before '('  [pep8/E211] [5]
Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/python_unittests.py:3:  indentation is not a multiple of four  [pep8/E111] [5]
Traceback (most recent call last):
  File "Tools/Scripts/check-webkit-style", line 46, in <module>
    sys.exit(CheckWebKitStyle().main())
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/style/main.py", line 154, in main
    patch_checker.check(patch)
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/style/patchreader.py", line 66, in check
    self._text_file_reader.process_file(file_path=path, line_numbers=line_numbers)
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/style/filereader.py", line 130, in process_file
    self._processor.process(lines, file_path, **kwargs)
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/style/checker.py", line 817, in process
    checker.check(lines)
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/style/checkers/python.py", line 56, in check
    errors = checker.check_all()
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/thirdparty/autoinstalled/pep8.py", line 911, in check_all
    self.check_logical()
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/thirdparty/autoinstalled/pep8.py", line 874, in check_logical
    result = self.run_check(check, argument_names)
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/thirdparty/autoinstalled/pep8.py", line 808, in run_check
    return check(*arguments)
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/thirdparty/autoinstalled/pep8.py", line 464, in missing_whitespace_around_operator
    if ((prev_type != tokenize.OP or prev_text in '}])') and not
TypeError: 'in <string>' requires string as left operand, not NoneType


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Kentaro Hara 2011-12-25 00:09:55 PST
Committed r103667: <http://trac.webkit.org/changeset/103667>