With a compass it is easy to determine the magnetic polarity of a pickup´s polepieces. Simply hold it to the polepieces and watch which end of the compass needle is attracted. If the south-end is showing to the pickup, the polepieces have the north poles on the top of the coil (If the south pole is at the top of the pickup, the north-end of the compass needle is attracted). You will only need the compass once if you mark the magnetic polarity on a "reference" magnet with the above-mentioned method. If this magnet is then repelled by a polepiece, the polepiece has the same polarity as the side of the reference magnet that is held to it.
Excerpt from my book Building Electric Guitars