'To revise for an exam' idiom
You can  say 我(正在)为考试而复习. Colloquially, we usually separate it into two pieces: 快考试了，我得复习了。；我得复习了，要考试了。

There are some other alternatives like 我要备考了，我正在备考，etc. , which means I'm preparing for my exam.