If you have confidence in your pronunciation, you can skip class. If it is not very good, I suggest you go to class, after all, it will help you improve.
Besides, I haven't heard of any place where exams are not allowed unless you attend classes. We all go to the examination center to pay the examination fee, so we can go directly to the examination room during the examination.
If you apply, you can go directly to the local Putonghua test station (provided that there is a Putonghua proficiency test point in this city). You can consult the local education bureau (they generally know) or a university with a Putonghua test center.
Also, the exam results are graded by the examiner according to the situation of each link of your exam. The examiner is a tester in the Putonghua Testing Center. That is to say, how many points are deducted for your mistakes? The fewer mistakes, the higher the score. It has nothing to do with training institutions.