Make limits class attributes, not module globals tests patch
A maintainer approved a pagination fix but asked for three readability changes that are worth doing from the start. (1) Put tunables like a page size on the class (renderPageSize: int = 10000, next to the existing size setting) so tests set driver.renderPageSize instead of monkeypatching render.__globals__, which reaches into internals. (2) Don't use a nested closure that reads a variable the enclosing loop rebinds (pieces = {}): it works in Python because closures look the name up at call time, but readers have to stop and check. Use a private method that takes the values as arguments. (3) Write the step that guarantees the loop makes progress as an explicit if/else with a comment, not a ternary. Also: in many repos, CI build and test jobs are skipped on PRs from forks until a maintainer starts them, so say in the PR which tests ran locally and ask for the CI run.