OLD | NEW |
1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 and self.parsed_specifiers == other.parsed_specifiers | 395 and self.parsed_specifiers == other.parsed_specifiers |
396 and self.matching_configurations == other.matching_configurations | 396 and self.matching_configurations == other.matching_configurations |
397 and self.expectations == other.expectations | 397 and self.expectations == other.expectations |
398 and self.parsed_expectations == other.parsed_expectations | 398 and self.parsed_expectations == other.parsed_expectations |
399 and self.comment == other.comment | 399 and self.comment == other.comment |
400 and self.matching_tests == other.matching_tests | 400 and self.matching_tests == other.matching_tests |
401 and self.warnings == other.warnings | 401 and self.warnings == other.warnings |
402 and self.is_skipped_outside_expectations_file == other.is_skipped_ou
tside_expectations_file) | 402 and self.is_skipped_outside_expectations_file == other.is_skipped_ou
tside_expectations_file) |
403 | 403 |
404 def is_invalid(self): | 404 def is_invalid(self): |
405 return self.warnings and self.warnings != [TestExpectationParser.MISSING
_BUG_WARNING] | 405 return bool(self.warnings and self.warnings != [TestExpectationParser.MI
SSING_BUG_WARNING]) |
406 | 406 |
407 def is_flaky(self): | 407 def is_flaky(self): |
408 return len(self.parsed_expectations) > 1 | 408 return len(self.parsed_expectations) > 1 |
409 | 409 |
410 def is_whitespace_or_comment(self): | 410 def is_whitespace_or_comment(self): |
411 return bool(re.match("^\s*$", self.original_string.split('#')[0])) | 411 return bool(re.match("^\s*$", self.original_string.split('#')[0])) |
412 | 412 |
413 @staticmethod | 413 @staticmethod |
414 def create_passing_expectation(test): | 414 def create_passing_expectation(test): |
415 expectation_line = TestExpectationLine() | 415 expectation_line = TestExpectationLine() |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 # If reconstitute_only_these is an empty list, we want to return ori
ginal_string. | 1103 # If reconstitute_only_these is an empty list, we want to return ori
ginal_string. |
1104 # So we need to compare reconstitute_only_these to None, not just ch
eck if it's falsey. | 1104 # So we need to compare reconstitute_only_these to None, not just ch
eck if it's falsey. |
1105 if reconstitute_only_these is None or expectation_line in reconstitu
te_only_these: | 1105 if reconstitute_only_these is None or expectation_line in reconstitu
te_only_these: |
1106 return expectation_line.to_string(test_configuration_converter) | 1106 return expectation_line.to_string(test_configuration_converter) |
1107 return expectation_line.original_string | 1107 return expectation_line.original_string |
1108 | 1108 |
1109 def nones_out(expectation_line): | 1109 def nones_out(expectation_line): |
1110 return expectation_line is not None | 1110 return expectation_line is not None |
1111 | 1111 |
1112 return "\n".join(filter(nones_out, map(serialize, expectation_lines))) | 1112 return "\n".join(filter(nones_out, map(serialize, expectation_lines))) |
OLD | NEW |