The first test you should do is to remove the engine cover and find the ignition coil. Find the small shut-off wire that goes to the coil. Remove the shut-off wire and then turn the engine over and test the spark again.
If you get spark, then the problem is in the safety switch system...clutch/brake pedal....mower engagement switch, ..or another safety switch. A slight possibility is that the ignition switch could be bad, but this is unlikely.
If you do not get spark with this test, then the ignition coil is most likely bad and will need to be replaced.
Feel free to contact me here at this question anytime ...even after you hit the "ACCEPT" button ...and I will try to help further.
Please click "ACCEPT" or I won't get paid.You may also consider sending a bonus if I have been helpful, Please leave POSITIVE feedback for me as this is how I'm rated. Remember, a neutral is nearly as bad as a negative. If not satisfied, contact me and I will make it right. Thanks