Minified assert_equal() using only the list diff.
(self, *args, **kwargs)
| 11512 | ############ |
| 11513 | |
| 11514 | def __assert_eq(self, *args, **kwargs): |
| 11515 | """Minified assert_equal() using only the list diff.""" |
| 11516 | minified_exception = None |
| 11517 | try: |
| 11518 | self.assertEqual(*args, **kwargs) |
| 11519 | except Exception as e: |
| 11520 | str_e = str(e) |
| 11521 | minified_exception = "\nAssertionError:\n" |
| 11522 | lines = str_e.split("\n") |
| 11523 | countdown = 3 |
| 11524 | countdown_on = False |
| 11525 | first_differing = False |
| 11526 | skip_lines = False |
| 11527 | for line in lines: |
| 11528 | if countdown_on: |
| 11529 | if not skip_lines: |
| 11530 | minified_exception += line + "\n" |
| 11531 | countdown = countdown - 1 |
| 11532 | if countdown == 0: |
| 11533 | countdown_on = False |
| 11534 | skip_lines = False |
| 11535 | elif line.startswith("First differing"): |
| 11536 | first_differing = True |
| 11537 | countdown_on = True |
| 11538 | countdown = 3 |
| 11539 | minified_exception += line + "\n" |
| 11540 | elif line.startswith("First list"): |
| 11541 | countdown_on = True |
| 11542 | countdown = 3 |
| 11543 | if not first_differing: |
| 11544 | minified_exception += line + "\n" |
| 11545 | else: |
| 11546 | skip_lines = True |
| 11547 | elif line.startswith("F"): |
| 11548 | countdown_on = True |
| 11549 | countdown = 3 |
| 11550 | minified_exception += line + "\n" |
| 11551 | elif line.startswith(("+", "-")): |
| 11552 | minified_exception += line + "\n" |
| 11553 | elif line.startswith("?"): |
| 11554 | minified_exception += line + "\n" |
| 11555 | elif line.strip().startswith("*"): |
| 11556 | minified_exception += line + "\n" |
| 11557 | if minified_exception: |
| 11558 | raise VisualException(minified_exception) |
| 11559 | |
| 11560 | def _process_visual_baseline_logs(self): |
| 11561 | if not ( |
no test coverage detected