test: Fix tests for python >= 3.8 (annotations)