def METHOD_NAME(model, solver, io, test_case):
    is_expected_failure = test_case.status == 'expected failure'
    #
    # Create a function that executes the test
    #
    def failed_solve_test(self):
        # Create the model test class
        model_class = test_case.model()
        # Create the model instance
        model_class.generate_model(test_case.testcase.import_suffixes)
        model_class.warmstart_model()
        # solve
        load_solutions = True
        symbolic_labels = False
        out = StringIO()
        with LoggingIntercept(out, 'pyomo.solvers'):
            with LoggingIntercept(out, 'pyomo.opt'):
                opt, results = model_class.solve(
                    solver,
                    io,
                    test_case.testcase.io_options,
                    test_case.testcase.options,
                    symbolic_labels,
                    load_solutions,
                )
        model_class.post_solve_test_validation(self, results)
        if len(results.solution) == 0:
            self.assertIn("No solution is available", out.getvalue())
        else:
            # Note ASL solvers might still return a solution
            # file with garbage values in it for a failed solve
            self.assertEqual(len(results.solution), 1)
    # Skip this test if the status is 'skip'
    if test_case.status == 'skip':
        def return_test(self):
            return self.skipTest(test_case.msg)
    elif is_expected_failure:
        @unittest.expectedFailure
        def return_test(self):
            return failed_solve_test(self)
    else:
        # Return a normal test
        def return_test(self):
            return failed_solve_test(self)
    unittest.pytest.mark.solver(solver)(return_test)
    return return_test