[pytest] drop compatibility code for python < 2.4 (related to #264017) [applied]