Add more optimization tests (#171)

* Integrated single_test_optimization into pytest to run a basic optimization test with tolerance set to 1e-6, ensuring quick detection of deviations.
* Added a long-run test (400 generations, like single_test_optimization), which can be triggered using --full-run in pytest.
* Mocked PDF creation in optimization tests and added a new PDF generation test with image comparison validation.

Note: Current tolerance is set to 1e-6; feedback on whether this tolerance is tight enough is welcome.

---------

Co-authored-by: Normann <github@koldrack.com>
Co-authored-by: Michael Osthege <michael.osthege@outlook.com>
This commit is contained in:
Dominique Lasserre
2024-11-10 23:22:30 +01:00
committed by GitHub
parent de9fe2ddc9
commit 3652298134
10 changed files with 395 additions and 10 deletions

View File

@@ -6,6 +6,17 @@ import pytest
from xprocess import ProcessStarter
def pytest_addoption(parser):
parser.addoption(
"--full-run", action="store_true", default=False, help="Run with all optimization tests."
)
@pytest.fixture
def is_full_run(request):
yield bool(request.config.getoption("--full-run"))
@pytest.fixture
def server(xprocess):
class Starter(ProcessStarter):