Vatican ! states
“. . . the Roman Pontiff, when he speaks ex cathedra, that is,
when, acting in the office of shepherd and teacher of all
Christians, he defines, by virtue of his supreme apostolic
authority, doctrine concerning faith or morals to be held by
the universal Church, possesses through the divine assistance promised to him in the person of St. Peter, the infallibility with which the divine Redeemer willed his Church to be endowed in defining doctrine concerning faith or morals; and that such definitions of the Roman Pontiff are therefore irreformable
because of their nature, but not because of the agreement of
the Church.” [First Dogmatic Constitution on the Church of Christ]
thus there are, clearly, four tests of infallibility:
The Pope must be (1) intending to teach (2) by virtue of his supreme apostolic authority (3) a matter of Faith or morals (4) to be held by the universal Church.
Unless one of these four are missing the Pope is teaching infallibly.
This has been done thousands of times by the Popes.