That's true as long as the results are predictable and reproducible. I don't happen to know if Black is, and it's not apparent from the documentation.
Update: Found it:
> How stable is Black’s style?
> Starting in 2022, the formatting output will be stable for the releases made in the same year
https://black.readthedocs.io/en/stable/faq.html