Skip to content

Commit

Permalink
Merge pull request Textualize#372 from Edward-Knight/deterministic_te…
Browse files Browse the repository at this point in the history
…st_data

Don't rely on set ordering for test data
  • Loading branch information
willmcgugan authored Oct 10, 2020
2 parents b0a68d3 + e6904fb commit af7fbf9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_pretty.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_install():

def test_pretty():
test = {
"foo": [1, 2, 3, {4, 5, 6, (7, 8, 9)}, {}],
"foo": [1, 2, 3, (4, 5, {6}, 7, 8, {9}), {}],
"bar": {"egg": "baz", "words": ["Hello World"] * 10},
False: "foo",
True: "",
Expand All @@ -28,7 +28,7 @@ def test_pretty():
result = pretty_repr(test, max_width=80)
print(result)
print(repr(result))
expected = "{\n 'foo': [1, 2, 3, {(7, 8, 9), 4, 5, 6}, {}],\n 'bar': {\n 'egg': 'baz',\n 'words': [\n 'Hello World',\n 'Hello World',\n 'Hello World',\n 'Hello World',\n 'Hello World',\n 'Hello World',\n 'Hello World',\n 'Hello World',\n 'Hello World',\n 'Hello World'\n ]\n },\n False: 'foo',\n True: '',\n 'text': ('Hello World', 'foo bar baz egg')\n}"
expected = "{\n 'foo': [1, 2, 3, (4, 5, {6}, 7, 8, {9}), {}],\n 'bar': {\n 'egg': 'baz',\n 'words': [\n 'Hello World',\n 'Hello World',\n 'Hello World',\n 'Hello World',\n 'Hello World',\n 'Hello World',\n 'Hello World',\n 'Hello World',\n 'Hello World',\n 'Hello World'\n ]\n },\n False: 'foo',\n True: '',\n 'text': ('Hello World', 'foo bar baz egg')\n}"
assert result == expected


Expand Down

0 comments on commit af7fbf9

Please sign in to comment.