'Check that infinity doesn\'t automatically get marked correct.
This resolves a bug where a problem with relative tolerance would
pass with any arbitrarily large student answer.'

def test_grade_infinity(self):

    mapping = {'some    big    input': float('inf'), 'some    neg    input': (- float('inf')), 'weird    NaN    input': float('nan'), '4': 4}
    def evaluator_side_effect(_, __, math_string):
        'Look    up    the    given    response    for    `math_string`.'
        return mapping[math_string]
    problem = self.build_problem(answer=4, tolerance='10%')
    with mock.patch('capa.responsetypes.evaluator') as mock_eval:
        mock_eval.side_effect = evaluator_side_effect
        self.assert_grade(problem, 'some    big    input', 'incorrect')
        self.assert_grade(problem, 'some    neg    input', 'incorrect')
        self.assert_grade(problem, 'weird    NaN    input', 'incorrect')
