Skip to content

Commit c197707

Browse files
committed
Pin the known compression bugs as expected-failure examples
Previously each known bug replaced the affected test for its backend with an expectedFailure version, so the test as a whole was expected to fail and nothing checked that the failure was the known one. With example.xfail() in the stubs (gh-160356), the known inputs are now expected-failure examples on the affected test: the generated input leaves the failing region out, as the comments say, and each example must fail, so the test fails again once the bug is fixed. For the needs_input bug (gh-159999) the generated calls for bz2 and zlib are unlimited, which is the case they get right; the examples depend on where the compressor puts block boundaries, so each has been checked to fail with both zlib 1.3.2 and zlib-ng 1.3.1, since the expected failures are strict. The FDICT examples (gh-160001) go on the zlib wrapper's test_invalid_input, which now clears the flag in generated garbage rather than skipping the input, and they are only registered in release builds, where the missing exception is a SystemError rather than a fatal assertion. The max_length=0 tests for lzma and zstd stop short of the failing call (gh-160000, gh-160121). Hypothesis also found that the broad zstd tests could reach gh-160121 with sixteen zero-length calls in a row, so zstd now shares the lzma carve-out of max_length=0, in the companions and the state machine. The subTest calls inside the invalid-input and zdict checks are gone: Hypothesis disables subTest under @given anyway, and inside the stub replay they swallowed the exception an expected-failure example has to raise.
1 parent 1c86a3e commit c197707

1 file changed

Lines changed: 214 additions & 184 deletions

File tree

0 commit comments

Comments
 (0)