Python: eliminate some more warnings in tests