I know that aperture affects the appearance of dust on a camera's sensor (or, technically, the filter in front of the sensor), but does focus matter at all?
Since the dust is behind the lens, I wouldn't think it matters at all whether the light rays hitting the dust happen to be coming from an object that's sharply rendered.
My camera has an automatic "Dust Alert" feature. I noticed that this feature is unavailable when the focus mode is switched to manual mode, and that when activated, it immediately racks the lens out to the farthest slightly-past-infinity focus (regardless of what I'm pointing it at). Is there something about this infinity-and-beyond focus that makes dust stand out more clearly? (And does that mean that sensor dust would be less apparent in macro photographs?)