def test_seeking_backwards_from_current(self): with EncodedFile(io.BytesIO(COMPRESSED)) as fp: contents = fp.read() fp.seek(-100, io.SEEK_CUR) self.assertEqual(fp.read(), contents[-100:])