'Verify uses of tolerance and rtol.
This test should be removed in the next astropy version.'

def test_deprecation_tolerance(self):

    ha = Header([('B', 1.0), ('C', 0.1)])
    hb = ha.copy()
    hb['B'] = 1.00001
    hb['C'] = 0.100001
    with catch_warnings(AstropyDeprecationWarning) as warning_lines:
        diff = HeaderDiff(ha, hb, tolerance=1e-06)
        assert (warning_lines[0].category == AstropyDeprecationWarning)
        assert (str(warning_lines[0].message) == '"tolerance"    was    deprecated    in    version    2.0    and    will    be    removed    in    a    future    version.    Use    argument    "rtol"    instead.')
        assert (diff.diff_keyword_values == {'C': [(0.1, 0.100001)], 'B': [(1.0, 1.00001)]})
        assert (not diff.identical)
    with catch_warnings(AstropyDeprecationWarning) as warning_lines:
        diff = HeaderDiff(ha, hb, rtol=1e-06, tolerance=1e-05)
        assert (warning_lines[0].category == AstropyDeprecationWarning)
        assert (str(warning_lines[0].message) == '"tolerance"    was    deprecated    in    version    2.0    and    will    be    removed    in    a    future    version.    Use    argument    "rtol"    instead.')
        assert diff.identical
