parametrized number of pages for pdf fixture
This commit is contained in:
parent
29fb0dda30
commit
c315247625
9
test/fixtures/input.py
vendored
9
test/fixtures/input.py
vendored
@ -37,11 +37,16 @@ def target_data_items(input_data_items, item_type, operation, metadata):
|
||||
return expected
|
||||
|
||||
|
||||
@pytest.fixture(params=[0, 1, 2, 5, 10])
|
||||
@pytest.fixture(params=[0, 1, 5, 10])
|
||||
def n_items(request):
|
||||
return request.param
|
||||
|
||||
|
||||
@pytest.fixture(params=[0, 5, 100])
|
||||
def n_pages(request):
|
||||
return request.param
|
||||
|
||||
|
||||
def array_to_image(array) -> Image.Image:
|
||||
return Image.fromarray(np.uint8(array * 255), mode="RGB")
|
||||
|
||||
@ -50,7 +55,7 @@ def input_batch(n_items):
|
||||
return np.random.random_sample(size=(n_items, 3, 30, 30))
|
||||
|
||||
|
||||
@pytest.fixture(params=[1, 2, 5, 100])
|
||||
@pytest.fixture(params=[1, 5, 90])
|
||||
def buffer_size(request):
|
||||
return request.param
|
||||
|
||||
|
||||
6
test/fixtures/pdf.py
vendored
6
test/fixtures/pdf.py
vendored
@ -5,9 +5,9 @@ from test.utils.pdf import pdf_stream
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def pdf():
|
||||
def pdf(n_pages):
|
||||
pdf = fpdf.FPDF(unit="pt")
|
||||
pdf.add_page()
|
||||
pdf.add_page()
|
||||
for _ in range(n_pages + 1):
|
||||
pdf.add_page()
|
||||
|
||||
return pdf_stream(pdf)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user