• Nick Miller's avatar
    [ci][python-package] Enforce and fix ruff flake8-pytest-style (PT) linting codes (#6959) · 0ec55c97
    Nick Miller authored
    
    
    * 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: default avatarNikita Titov <nekit94-08@mail.ru>
    0ec55c97
test_sklearn.py 86.5 KB