Judges 2:21-22

2:21 So I will no longer remove before them any of the nations that Joshua left unconquered when he died. 2:22 Joshua left those nations to test Israel. I wanted to see whether or not the people would carefully walk in the path marked out by the Lord, as their ancestors were careful to do.”

Deuteronomy 7:22

7:22 He, the God who leads you, will expel the nations little by little. You will not be allowed to destroy them all at once lest the wild animals overrun you.