Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STY: Fix style issues #58

Merged
merged 4 commits into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ ignore = [
"FBT003",
# Ignore checks for possible passwords
"S105", "S106", "S107",
]
unfixable = [
# Don't touch unused imports
"F401",
# Ignore noisy checks for insecure subprocess calls
"S603", "S607",
# Boolean default values
"FBT002",
]

[tool.ruff.isort]
Expand Down
11 changes: 7 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,30 @@
# SPDX-License-Identifier: MIT
import errno
import os
import shutil
import stat
import tempfile
from contextlib import contextmanager
from functools import wraps
from sys import version_info

if version_info[:2] >= (3, 12):
from shutil import rmtree
else:
from shutil import rmtree as _rmtree

# Wrap rmtree to backport the onexc keyword argument from Python 3.12
# Backport the onexc keyword argument from Python 3.12
@wraps(_rmtree)
def rmtree(path, ignore_errors=False, onerror=None, *args, **kwds):
if "onexc" in kwds:
if 'onexc' in kwds:
kwds = dict(kwds)
onexc = kwds.pop("onexc")
onexc = kwds.pop('onexc')

def onerror(func, path, exc):
return onexc(func, path, exc[1])

return _rmtree(path, ignore_errors, onerror, *args, **kwds)


import pytest

from .utils import create_file, git, write_file
Expand Down