Skip to content

Commit

Permalink
Fix Travis failures (#68)
Browse files Browse the repository at this point in the history
* Reformatted with new version of black

* Update to modern jarvis parlance

* Flake8 has a new warning too
  • Loading branch information
regebro committed Oct 26, 2020
1 parent 34b810f commit bef611b
Show file tree
Hide file tree
Showing 9 changed files with 621 additions and 605 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
@@ -1,13 +1,13 @@
language: python
dist: xenial
os: linux

# Travis doesn't support 3.7 by default, but if we run it on xenial it works
matrix:
jobs:
fast_finish: true
include:
- python: 3.6
env: MATRIX=py36
- python: 3.7
sudo: required
dist: bionic
env: MATRIX=py37
- python: pypy3
Expand Down
6 changes: 5 additions & 1 deletion setup.py
Expand Up @@ -33,7 +33,11 @@
packages=find_packages(exclude=["doc", "tests"]),
include_package_data=True,
zip_safe=False,
install_requires=["setuptools", "lxml>=3.1.0", "six",],
install_requires=[
"setuptools",
"lxml>=3.1.0",
"six",
],
test_suite="tests",
entry_points={
"console_scripts": [
Expand Down
12 changes: 10 additions & 2 deletions tests/test_diff.py
Expand Up @@ -796,7 +796,10 @@ def test_match_insert_node(self):
result = self._match(left, right)
self.assertEqual(
result,
[("/document/story", "/document/story"), ("/document", "/document"),],
[
("/document/story", "/document/story"),
("/document", "/document"),
],
)

def test_entirely_different(self):
Expand All @@ -810,7 +813,12 @@ def test_entirely_different(self):
<h1>Inserted <i>Node</i></h1>
</document>"""
result = self._match(left, right)
self.assertEqual(result, [("/document", "/document"),])
self.assertEqual(
result,
[
("/document", "/document"),
],
)


class FastMatchTests(unittest.TestCase):
Expand Down
7 changes: 6 additions & 1 deletion tests/test_formatting.py
Expand Up @@ -99,7 +99,12 @@ def test_rml_bug(self):
</document>"""
tree = etree.fromstring(before_diff)
replacer = formatting.PlaceholderMaker(
text_tags=("para",), formatting_tags=("b", "u", "i",)
text_tags=("para",),
formatting_tags=(
"b",
"u",
"i",
),
)
replacer.do_tree(tree)
after_diff = """<document xmlns:diff="http://namespaces.shoobx.com/diff">
Expand Down
4 changes: 2 additions & 2 deletions tests/testing.py
Expand Up @@ -42,5 +42,5 @@ def compare_elements(left, right):
assert left.attrib == right.attrib, "Attributes differ: %s" % path
# We intentionally do NOT compare namespaces, they are allowed to differ
assert len(left) == len(right), "Children differ: %s" % path
for l, r in zip(left.getchildren(), right.getchildren()):
compare_elements(l, r)
for litem, ritem in zip(left.getchildren(), right.getchildren()):
compare_elements(litem, ritem)

0 comments on commit bef611b

Please sign in to comment.