Skip to content

Commit f9d8537

Browse files
committed
fiddle with the pixeldiffs on the layout test
1 parent e967f10 commit f9d8537

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

chapter_08_prettification.asciidoc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ Traceback (most recent call last):
167167
File "...goat-book/functional_tests/tests.py", line 120, in
168168
test_layout_and_styling
169169
self.assertAlmostEqual(
170-
AssertionError: 103.333... != 512 within 10 delta (408.666...
171-
difference)
170+
AssertionError: 102.5 != 512 within 10 delta (409.5 difference)
172171
173172
---------------------------------------------------------------------
174173
Ran 3 tests in 9.188s
@@ -226,7 +225,7 @@ That gives us another test failure:
226225
File "...goat-book/functional_tests/tests.py", line 132, in
227226
test_layout_and_styling
228227
self.assertAlmostEqual(
229-
AssertionError: 103.333... != 512 within 10 delta (408.666...
228+
AssertionError: 102.5 != 512 within 10 delta (409.5 difference)
230229
----
231230

232231
Let's commit just the FT:
@@ -492,7 +491,7 @@ That's a refactor of the way our templates work.
492491
We rerun the FTs to make sure we haven't broken anything:
493492

494493
----
495-
AssertionError: 103.333... != 512 within 10 delta (408.666...
494+
AssertionError: 102.5 != 512 within 10 delta (409.5 difference)
496495
----
497496

498497
Sure enough, they're still getting to exactly where they were before.
@@ -600,7 +599,7 @@ TIP: Take the time to browse through the
600599
Does that work?
601600

602601
----
603-
AssertionError: 103.333... != 512 within 10 delta (408.666...
602+
AssertionError: 102.5 != 512 within 10 delta (409.5 difference)
604603
----
605604

606605
Hmm. No. Why isn't our CSS loading?
@@ -713,7 +712,7 @@ image::images/prettified-1.png["The list page with centered header."]
713712
If you run the FT though, annoyingly, it still won't pass:
714713

715714
----
716-
AssertionError: 103.333... != 512 within 10 delta (408.666...
715+
AssertionError: 102.5 != 512 within 10 delta (409.5 difference)
717716
----
718717

719718
That's because, although `runserver` automagically finds static files,

chapter_10_production_readiness.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ but the test for layout + styling fails. Good job, tests!
8989
----
9090
$ pass:quotes[*TEST_SERVER=localhost:8888 python manage.py test functional_tests*]
9191
[...]
92-
AssertionError: 117.0 != 512 within 10 delta
92+
AssertionError: 102.5 != 512 within 10 delta (409.5 difference)
9393
FAILED (failures=1)
9494
----
9595

@@ -375,7 +375,7 @@ in our static files.
375375
----
376376
$ pass:quotes[*TEST_SERVER=localhost:8888 python manage.py test functional_tests*]
377377
[...]
378-
AssertionError: 117.0 != 512 within 10 delta
378+
AssertionError: 102.5 != 512 within 10 delta (409.5 difference)
379379
FAILED (failures=1)
380380
----
381381

tests/book_tester.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ def fix_sqlite_messages(actual_text):
195195

196196
def standardize_layout_test_pixelsize(actual_text):
197197
return re.sub(
198-
r"103.333\d+ != 512 within 10 delta \(408.666\d+",
199-
r"103.333... != 512 within 10 delta (408.666...",
198+
r"10\d.\d+ != 512 within 10 delta \(40\d.\d+",
199+
r"102.5 != 512 within 10 delta (409.5",
200200
actual_text,
201201
)
202202

0 commit comments

Comments
 (0)