"git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "ce3e31219c568323d66fa6e918fffcb96b3df92a"
[ci][python-package] Enforce and fix ruff flake8-pytest-style (PT) linting codes (#6959)
* Add "PT" ruff code to pyproject.toml plus some exceptions
* Extend PT011 for Exception, IndexError, TypeError
* Fix PT001: Use `@pytest.fixture` over `@pytest.fixture()`
* Fix PT011: pytest.raises({exception}) is too broad, set the match parameter or use a more specific exception
* Fix PT012: `pytest.raises()` block should contain a single simple statement
* Fix PT017: Found assertion on exception {name} in except block, use pytest.raises() instead
* Fix PT018: Assertion should be broken down into multiple parts
* Remove PT006 and PT007 from ignore list and fixup
* Use *Exception and *Error glob to apply PT011 and ignore AssertionErrors
---------
Co-authored-by:
Nikita Titov <nekit94-08@mail.ru>
Showing
Please register or sign in to comment