Changeset 107293 in webkit


Ignore:
Timestamp:
Feb 9, 2012 2:33:16 PM (12 years ago)
Author:
dpranke@chromium.org
Message:

some tests in webkitpy are being run three times
https://bugs.webkit.org/show_bug.cgi?id=78283

Reviewed by Ryosuke Niwa.

It turns out that if you import a class derived from
unittest.TestCase as a base name (e.g., from ... import ChangeLogTest),
the unittest framework treats it as if the class was defined in
the file (as well in the original file). This led us to running
the tests in ChangeLogTest three times.

  • Scripts/webkitpy/tool/steps/preparechangelog_unittest.py:

(PrepareChangeLogTest):

  • Scripts/webkitpy/tool/steps/preparechangelogforrevert_unittest.py:

(_assert_message_for_revert_output):

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r107286 r107293  
     12012-02-09  Dirk Pranke  <dpranke@chromium.org>
     2
     3        some tests in webkitpy are being run three times
     4        https://bugs.webkit.org/show_bug.cgi?id=78283
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        It turns out that if you import a class derived from
     9        unittest.TestCase as a base name (e.g., from ... import ChangeLogTest),
     10        the unittest framework treats it as if the class was defined in
     11        the file (as well in the original file). This led us to running
     12        the tests in ChangeLogTest three times.
     13
     14        * Scripts/webkitpy/tool/steps/preparechangelog_unittest.py:
     15        (PrepareChangeLogTest):
     16        * Scripts/webkitpy/tool/steps/preparechangelogforrevert_unittest.py:
     17        (_assert_message_for_revert_output):
     18
    1192012-02-09  Adam Barth  <abarth@webkit.org>
    220
  • trunk/Tools/Scripts/webkitpy/tool/steps/preparechangelog_unittest.py

    r91724 r107293  
    3030import unittest
    3131
    32 from webkitpy.common.checkout.changelog_unittest import ChangeLogTest
     32# Do not import changelog_unittest.ChangeLogTest directly as that will cause it to be run again.
     33from webkitpy.common.checkout import changelog_unittest
     34
    3335from webkitpy.common.system.outputcapture import OutputCapture
    3436from webkitpy.tool.mocktool import MockOptions, MockTool
     
    3638
    3739
    38 class PrepareChangeLogTest(ChangeLogTest):
     40class PrepareChangeLogTest(changelog_unittest.ChangeLogTest):
    3941    def test_ensure_bug_url(self):
    4042        capture = OutputCapture()
  • trunk/Tools/Scripts/webkitpy/tool/steps/preparechangelogforrevert_unittest.py

    r107136 r107293  
    3232import unittest
    3333
     34# Do not import changelog_unittest.ChangeLogTest directly as that will cause it to be run again.
     35from webkitpy.common.checkout import changelog_unittest
     36
    3437from webkitpy.common.checkout.changelog import ChangeLog
    35 from webkitpy.common.checkout.changelog_unittest import ChangeLogTest
    3638from webkitpy.tool.steps.preparechangelogforrevert import *
    3739
     
    108110
    109111    def _assert_message_for_revert_output(self, args, expected_entry):
    110         changelog_contents = u"%s\n%s" % (ChangeLogTest._new_entry_boilerplate, ChangeLogTest._example_changelog)
     112        changelog_contents = u"%s\n%s" % (changelog_unittest.ChangeLogTest._new_entry_boilerplate, changelog_unittest.ChangeLogTest._example_changelog)
    111113        changelog_path = self._write_tmp_file_with_contents(changelog_contents.encode("utf-8"))
    112114        changelog = ChangeLog(changelog_path)
Note: See TracChangeset for help on using the changeset viewer.