def METHOD_NAME(self, subtests):
    # OffsetUnitCalculusError raised from a custom ureg must be pickleable even if
    # the ureg is not registered as the application ureg
    ureg = UnitRegistry(filename=None)
    ureg.define("foo = [bar]")
    ureg.define("bar = 2 foo")
    q1 = ureg.Quantity("1 foo")
    q2 = ureg.Quantity("1 bar")
    for protocol in range(pickle.HIGHEST_PROTOCOL + 1):
        for ex in (
            DefinitionSyntaxError("foo"),
            RedefinitionError("foo", "bar"),
            UndefinedUnitError("meter"),
            DimensionalityError("a", "b", "c", "d", extra_msg=": msg"),
            OffsetUnitCalculusError(
                Quantity("1 kg")._units, Quantity("1 s")._units
            ),
            OffsetUnitCalculusError(q1._units, q2._units),
        ):
            with subtests.test(protocol=protocol, etype=type(ex)):
                pik = pickle.dumps(ureg.Quantity("1 foo"), protocol)
                with pytest.raises(UndefinedUnitError):
                    pickle.loads(pik)
                # assert False, ex.__reduce__()
                ex2 = pickle.loads(pickle.dumps(ex, protocol))
                print(ex)
                print(ex2)
                assert type(ex) is type(ex2)
                assert ex == ex
                # assert ex.__dict__ == ex2.__dict__
                assert str(ex) == str(ex2)
                with pytest.raises(PintError):
                    raise ex