def assert_failed(self, with_errors=False, with_warnings=None):
        assert self.err.failed(fail_on_warnings=with_warnings or
                                                with_warnings is None), \
                "Test did not fail; failure was expected."

        if with_errors:
            assert self.err.errors, "Errors were expected."
        elif self.err.errors:
            raise AssertionError("Tests found unexpected errors: %s" %
                                self.err.print_summary(verbose=True))

        if with_warnings is not None:
            if with_warnings:
                assert self.err.warnings, "Warnings were expected."
            elif self.err.warnings:
                raise ("Tests found unexpected warnings: %s" %
                           self.err.print_summary())
Return a MenuManager object that will generate the appropriate
dataset/ETHPy150Open mozilla/app-validator/tests/helper.py/TestCase.assert_failed--crossover with--dataset/ETHPy150Open enthought/pyface/pyface/ui/wx/grid/composite_grid_model.py/CompositeGridModel.get_cell_context_menu