本文整理汇总了Python中webkitpy.layout_tests.models.test_expectations.TestExpectations.get_expectations方法的典型用法代码示例。如果您正苦于以下问题:Python TestExpectations.get_expectations方法的具体用法?Python TestExpectations.get_expectations怎么用?Python TestExpectations.get_expectations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webkitpy.layout_tests.models.test_expectations.TestExpectations
的用法示例。
在下文中一共展示了TestExpectations.get_expectations方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _tests_to_rebaseline
# 需要导入模块: from webkitpy.layout_tests.models.test_expectations import TestExpectations [as 别名]
# 或者: from webkitpy.layout_tests.models.test_expectations.TestExpectations import get_expectations [as 别名]
def _tests_to_rebaseline(self, port):
tests_to_rebaseline = {}
expectations = TestExpectations(port, include_overrides=True)
for test in expectations.get_rebaselining_failures():
suffixes = TestExpectations.suffixes_for_expectations(expectations.get_expectations(test))
tests_to_rebaseline[test] = suffixes or BASELINE_SUFFIX_LIST
return tests_to_rebaseline
示例2: _tests_to_rebaseline
# 需要导入模块: from webkitpy.layout_tests.models.test_expectations import TestExpectations [as 别名]
# 或者: from webkitpy.layout_tests.models.test_expectations.TestExpectations import get_expectations [as 别名]
def _tests_to_rebaseline(port):
tests_to_rebaseline = {}
for path, value in port.expectations_dict().items():
expectations = TestExpectations(port, include_overrides=False, expectations_dict={path: value})
for test in expectations.get_rebaselining_failures():
suffixes = TestExpectations.suffixes_for_expectations(expectations.get_expectations(test))
tests_to_rebaseline[test] = suffixes or BASELINE_SUFFIX_LIST
return tests_to_rebaseline
示例3: _port_skips_test
# 需要导入模块: from webkitpy.layout_tests.models.test_expectations import TestExpectations [as 别名]
# 或者: from webkitpy.layout_tests.models.test_expectations.TestExpectations import get_expectations [as 别名]
def _port_skips_test(self, port, test, generic_expectations):
fs = port.host.filesystem
if port.default_smoke_test_only():
smoke_test_filename = fs.join(port.layout_tests_dir(), 'SmokeTests')
if fs.exists(smoke_test_filename) and test not in fs.read_text_file(smoke_test_filename):
return True
full_expectations = TestExpectations(port, tests=[test], include_overrides=True)
return (SKIP in full_expectations.get_expectations(test) and
SKIP not in generic_expectations.get_expectations(test))
示例4: _copy_existing_baseline
# 需要导入模块: from webkitpy.layout_tests.models.test_expectations import TestExpectations [as 别名]
# 或者: from webkitpy.layout_tests.models.test_expectations.TestExpectations import get_expectations [as 别名]
def _copy_existing_baseline(self, builder_name, test_name, suffix):
baseline_directory = self._baseline_directory(builder_name)
ports = [
self._port_for_primary_baseline(baseline)
for baseline in self._immediate_predecessors_in_fallback(baseline_directory)
]
old_baselines = []
new_baselines = []
# Need to gather all the baseline paths before modifying the filesystem since
# the modifications can affect the results of port.expected_filename.
for port in ports:
old_baseline = port.expected_filename(test_name, "." + suffix)
if not self._tool.filesystem.exists(old_baseline):
_log.debug("No existing baseline for %s.", test_name)
continue
new_baseline = self._tool.filesystem.join(
port.baseline_version_dir(), self._file_name_for_expected_result(test_name, suffix)
)
if self._tool.filesystem.exists(new_baseline):
_log.debug("Existing baseline at %s, not copying over it.", new_baseline)
continue
generic_expectations = TestExpectations(port, tests=[test_name], include_overrides=False)
full_expectations = TestExpectations(port, tests=[test_name], include_overrides=True)
# TODO(qyearsley): Change Port.skips_test so that this can be simplified.
if SKIP in full_expectations.get_expectations(test_name):
_log.debug("%s is skipped (perhaps temporarily) on %s.", test_name, port.name())
continue
if port.skips_test(test_name, generic_expectations, full_expectations):
_log.debug("%s is skipped on %s.", test_name, port.name())
continue
old_baselines.append(old_baseline)
new_baselines.append(new_baseline)
for i in range(len(old_baselines)):
old_baseline = old_baselines[i]
new_baseline = new_baselines[i]
_log.debug("Copying baseline from %s to %s.", old_baseline, new_baseline)
self._tool.filesystem.maybe_make_directory(self._tool.filesystem.dirname(new_baseline))
self._tool.filesystem.copyfile(old_baseline, new_baseline)
示例5: _copy_existing_baseline
# 需要导入模块: from webkitpy.layout_tests.models.test_expectations import TestExpectations [as 别名]
# 或者: from webkitpy.layout_tests.models.test_expectations.TestExpectations import get_expectations [as 别名]
def _copy_existing_baseline(self, builder_name, test_name, suffix):
baseline_directory = self._baseline_directory(builder_name)
ports = [
self._port_for_primary_baseline(baseline)
for baseline in self._immediate_predecessors_in_fallback(baseline_directory)
]
old_baselines = []
new_baselines = []
# Need to gather all the baseline paths before modifying the filesystem since
# the modifications can affect the results of port.expected_filename.
for port in ports:
old_baseline = port.expected_filename(test_name, "." + suffix)
if not self._tool.filesystem.exists(old_baseline):
_log.debug("No existing baseline for %s." % test_name)
continue
new_baseline = self._tool.filesystem.join(
port.baseline_path(), self._file_name_for_expected_result(test_name, suffix)
)
if self._tool.filesystem.exists(new_baseline):
_log.debug("Existing baseline at %s, not copying over it." % new_baseline)
continue
expectations = TestExpectations(port, [test_name])
if SKIP in expectations.get_expectations(test_name):
_log.debug("%s is skipped on %s." % (test_name, port.name()))
continue
old_baselines.append(old_baseline)
new_baselines.append(new_baseline)
for i in range(len(old_baselines)):
old_baseline = old_baselines[i]
new_baseline = new_baselines[i]
_log.debug("Copying baseline from %s to %s." % (old_baseline, new_baseline))
self._tool.filesystem.maybe_make_directory(self._tool.filesystem.dirname(new_baseline))
self._tool.filesystem.copyfile(old_baseline, new_baseline)
if not self._tool.scm().exists(new_baseline):
self._add_to_scm(new_baseline)