The correct answer is: will have finished.
I hope I will have finished my test by midnight. (Я надеюсь, что закончу мой тест к полуночи.)
This is Future Perfect Tense. It is used to describe an action that will be completed before a specific time in the future.