diff --git a/test/fixtures/page_generation/page.py b/test/fixtures/page_generation/page.py index a69c386..b70f6a6 100644 --- a/test/fixtures/page_generation/page.py +++ b/test/fixtures/page_generation/page.py @@ -1317,19 +1317,24 @@ def page_partitioner(request): return request.param() +@pytest.fixture +def boxes(page_partitioner, blank_page): + boxes = page_partitioner(blank_page) + return boxes + + @pytest.fixture def page_with_opaque_content( - blank_page, tinted_blank_page, texture, texture_fn, page_partitioner + blank_page, tinted_blank_page, texture, texture_fn, boxes ) -> Tuple[np.ndarray, Iterable[Rectangle]]: """Creates a page with content""" - texture = random_flip(texture) - texture = texture_fn(texture) - - boxes = page_partitioner(texture) content_generator = ContentGenerator() boxes = content_generator(boxes) + texture = random_flip(texture) + texture = texture_fn(texture) + page = paste_contents(texture, boxes) return page, boxes @@ -1337,18 +1342,17 @@ def page_with_opaque_content( @pytest.fixture def page_with_translucent_content( - blank_page, tinted_blank_page, texture, texture_fn, page_partitioner + blank_page, tinted_blank_page, texture, texture_fn, boxes ) -> Tuple[np.ndarray, List[Rectangle]]: """Creates a page with content""" - boxes = page_partitioner(blank_page) content_generator = ContentGenerator() boxes = content_generator(boxes) - page_content = paste_contents(blank_page, boxes) texture = random_flip(texture) texture = texture_fn(texture) + page_content = paste_contents(blank_page, boxes) page = blend_by_multiply(page_content, texture) return page, boxes