Use a fuel line clamp to close off the brake line hose, this prevents the brake fluid from draining out of system as you change a caliper or wheel cylinder.
( Be careful not to over tighten, want to tighten just enough to stop the dripping.) And one more thing REMEMBER TO REMOVE IT WHEN DONE, it is easy to forget.