diff options
author | Jens Diemer <github.com@jensdiemer.de> | 2020-02-13 10:41:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-13 10:41:24 +0100 |
commit | 1e2e2c4edb888b5c9a46f057880d441922878f5b (patch) | |
tree | 1eb9b13dd2b7fa6bef7135f01b41df7cd2413efa /creole/tests/utils/utils.py | |
parent | 00cbba43f0fcc8648bc1d2bb461647741f00bc4a (diff) | |
parent | 51a3622519aa0a04801038a95344f60040cae05c (diff) | |
download | creole-1e2e2c4edb888b5c9a46f057880d441922878f5b.tar.gz |
Merge pull request #47 from jedie/update
Update
Diffstat (limited to 'creole/tests/utils/utils.py')
-rw-r--r-- | creole/tests/utils/utils.py | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/creole/tests/utils/utils.py b/creole/tests/utils/utils.py index dd60454..d9fbf29 100644 --- a/creole/tests/utils/utils.py +++ b/creole/tests/utils/utils.py @@ -8,8 +8,6 @@ :license: GNU GPL v3 or above, see LICENSE for more details. """ - -import difflib import os import shutil import tempfile @@ -17,17 +15,7 @@ import textwrap import unittest from pathlib import Path - -def make_diff(block1, block2): - d = difflib.Differ() - - block1 = block1.replace("\\n", "\\n\n").split("\n") - block2 = block2.replace("\\n", "\\n\n").split("\n") - - diff = d.compare(block1, block2) - - result = [f"{line:>2} {i}\n" for line, i in enumerate(diff)] - return "".join(result) +from creole.shared.diff_utils import unified_diff class MarkupTest(unittest.TestCase): @@ -54,7 +42,7 @@ class MarkupTest(unittest.TestCase): return try: - diff = make_diff(first, second) + diff = unified_diff(first, second) except AttributeError: raise self.failureException(f"{first!r} is not {second!r}") |