MAINT: deduplicate some tests (discrete vs continuous distributions)

Move tests common to discrete and continuous distributions to a new
common_tests.py, and import from there.