This is a genuine matter of scholarly difference. Some scholars, including the Hanbalis and this is the view of Shaykh al-Islam Ibn Taymiyyah, hold that cupping breaks the fast based on the hadith 'The one who cups and the one cupped have broken their fast.' The majority (Hanafis, Malikis, Shafi'is), however, hold that it does not break the fast, citing that the Prophet was cupped while he was fasting. A prudent believer avoids cupping and large blood donation during the fasting day to be on the safe side, while a small blood test for diagnosis is agreed by contemporary scholars not to break the fast because the amount is minor.
Q&A · Fasting
Does cupping (hijamah), donating blood, or having a blood test break the fast?
Informational, not a personal fatwa. Consult a qualified scholar for rulings on your situation.