While you cannot hide a test from a single student or just a few students, you can prevent certain students from seeing a test if you set up "Grading Groups". I'd recommend creating two groups...one called PRESENT and the other ABSENT, then you'd place the students that are present in the PRESENT folder and the absent students in the ABSENT folder. Grades will be saved regardless of which group they are in so you can switch students in and out of folders and not lose scores. When you create the test, you can then use the "individually assign" feature using the Groups, instead of students (so you'd "individually assign" the PRESENT group the test, leaving the ABSENT group out so they cannot see it.).
Here is a link to set up Grading Groups.