Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#300)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Jan 30, 2024
1 parent 2af9401 commit b6e892e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black
- repo: https://github.com/tox-dev/tox-ini-fmt
Expand Down
1 change: 1 addition & 0 deletions src/filelock/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
:no-value:
"""

from __future__ import annotations

import sys
Expand Down
20 changes: 11 additions & 9 deletions tests/test_filelock.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,17 @@ def test_ro_file(lock_type: type[BaseFileLock], tmp_file_ro: Path) -> None:
pytest.param(FileNotFoundError, "No such file or directory:", "", id="blank_filename"),
pytest.param(ValueError, "embedded null (byte|character)", "\0", id="null_byte"),
# Should be PermissionError on Windows
pytest.param(PermissionError, "Permission denied:", ".", id="current_directory")
if sys.platform == "win32"
else (
# Should be IsADirectoryError on MacOS and Linux
pytest.param(IsADirectoryError, "Is a directory", ".", id="current_directory")
if sys.platform in ["darwin", "linux"]
else
# Should be some type of OSError at least on other operating systems
pytest.param(OSError, None, ".", id="current_directory")
(
pytest.param(PermissionError, "Permission denied:", ".", id="current_directory")
if sys.platform == "win32"
else (
# Should be IsADirectoryError on MacOS and Linux
pytest.param(IsADirectoryError, "Is a directory", ".", id="current_directory")
if sys.platform in ["darwin", "linux"]
else
# Should be some type of OSError at least on other operating systems
pytest.param(OSError, None, ".", id="current_directory")
)
),
]
+ [pytest.param(OSError, "Invalid argument", i, id=f"invalid_{i}", marks=WindowsOnly) for i in '<>:"|?*\a']
Expand Down

0 comments on commit b6e892e

Please sign in to comment.