Lint: run more flake8-pytest-style by hugovk · Pull Request #8309 · python-pillow/Pillow

Expand from PT006 to all of PT:

https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt

Fix warnings for PT001, PT014 and PT018.

Exclude these which have warnings:

  • PT007 pytest-parametrize-values-wrong-type
  • PT011 pytest-raises-too-broad
  • PT012 pytest-raises-with-multiple-statements
  • PT016 pytest-fail-without-message
  • PT017 pytest-assert-in-except

I'm fine if someone wants to tackle those in another PR.