Firstly, check is trying to move away from raising a single error at the first sign of trouble; raising BzrCheckError in code check uses takes that back a few steps. You could pass down a flag asking for an exception, or something. This occurs at least twice. I may be misreading though - the code in question might not be used by check at all.
+ repo = self.make_repository('damaged-repo')
255 + if not repo._format.supports_chks:
256 + raise TestNotApplicable('requires repository with chk_bytes')
So a few things.
Firstly, check is trying to move away from raising a single error at the first sign of trouble; raising BzrCheckError in code check uses takes that back a few steps. You could pass down a flag asking for an exception, or something. This occurs at least twice. I may be misreading though - the code in question might not be used by check at all.
+ repo = self.make_ repository( 'damaged- repo') supports_ chks: le('requires repository with chk_bytes')
255 + if not repo._format.
256 + raise TestNotApplicab
Please move these tests to per_repository_chks
Other than that it looks plausible to me.