Skip to content

Commit 4fb637d

Browse files
committed
Flake8 fixes
1 parent 7d19279 commit 4fb637d

11 files changed

Lines changed: 20 additions & 12 deletions

src/pytest_cases/case_funcs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def is_case_function(f: Any,
345345
else:
346346
try:
347347
return f.__name__.startswith(prefix) if check_prefix else True
348-
except:
348+
except: # noqa
349349
# GH#287: safe fallback
350350
return False
351351

@@ -379,4 +379,3 @@ def _decorator(cls):
379379
case_info.add_tags(tags_to_add)
380380
return cls
381381
return _decorator
382-

src/pytest_cases/case_parametrizer_new.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class ThisModule(enum.Enum):
5050
"""Class to allow type hints for the THIS_MODULE Singleton"""
5151
THIS_MODULE = object()
5252

53+
5354
THIS_MODULE = ThisModule.THIS_MODULE
5455
"""Singleton that can be used instead of a module name to indicate that the module is the current one"""
5556

@@ -700,7 +701,7 @@ def hasinit(obj):
700701
if init:
701702
return init != object.__init__
702703

703-
704+
704705
def hasnew(obj):
705706
new = getattr(obj, "__new__", None)
706707
if new:

src/pytest_cases/common_others.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ def get_code_first_line(f):
5454
ExpectedErrorValidator = Optional[Callable[[BaseException], Optional[bool]]]
5555

5656

57-
def unfold_expected_err(expected_e: ExpectedError
58-
) -> tuple[ExpectedErrorType, ExpectedErrorPattern, ExpectedErrorInstance, ExpectedErrorValidator]:
57+
def unfold_expected_err(
58+
expected_e: ExpectedError
59+
) -> tuple[ExpectedErrorType, ExpectedErrorPattern, ExpectedErrorInstance, ExpectedErrorValidator]:
5960
"""
6061
'Unfolds' the expected error `expected_e` to return a tuple of
6162
- expected error type
@@ -205,10 +206,12 @@ def __exit__(self, exc_type, exc_val, exc_tb):
205206
# See https://docs.python.org/2/reference/datamodel.html#object.__exit__
206207
return True
207208

209+
208210
class Auto(enum.Enum):
209211
"""Class to allow type hints for the AUTO Singleton"""
210212
AUTO = object()
211213

214+
212215
AUTO = Auto.AUTO
213216
"""Marker for automatic defaults"""
214217

src/pytest_cases/common_pytest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def make_test_ids(global_ids, id_marks, argnames=None, argvalues=None, precomput
363363

364364
def resolve_ids(ids: Optional[Union[Callable, Iterable[str]]],
365365
argvalues: Collection[Any],
366-
full_resolve: bool = False
366+
full_resolve: bool = False
367367
) -> Union[list[str], Callable]:
368368
"""
369369
Resolves the `ids` argument of a parametrized fixture.

src/pytest_cases/common_pytest_lazy_values.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def __hash__(self):
164164
return hash((self.__class__, self.valuegetter, self._id, self._marks))
165165

166166
def get_marks(self,
167-
as_decorators: bool = False
167+
as_decorators: bool = False
168168
) -> Union[tuple[Mark, ...], tuple[MarkDecorator, ...]]:
169169
"""
170170
Overrides default implementation to return the marks that are on the case function
@@ -480,7 +480,7 @@ def clone(self, remove_int_base=False):
480480

481481
def lazy_value(valuegetter: Callable[[], Any],
482482
id: str = None, # noqa
483-
marks: Union[MarkDecorator, Iterable[MarkDecorator]] = ()
483+
marks: Union[MarkDecorator, Iterable[MarkDecorator]] = ()
484484
):
485485
"""
486486
Creates a reference to a value getter, to be used in `parametrize`.

src/pytest_cases/fixture_core1_unions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ def _new_fixture(request, **all_fixtures):
432432
def unpack_fixture(argnames: str,
433433
fixture: Union[str, Callable],
434434
in_cls: bool = False,
435-
hook: Callable[[Callable], Callable] = None
435+
hook: Callable[[Callable], Callable] = None
436436
):
437437
"""
438438
Creates several fixtures with names `argnames` from the source `fixture`. Created fixtures will correspond to

src/pytest_cases/fixture_parametrize_plus.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def create(cls,
314314
id: Union[str, Callable],
315315
scope: str = None,
316316
hook: Callable = None,
317-
debug: bool = False
317+
debug: bool = False
318318
) -> 'SingleParamAlternative':
319319
"""
320320
Creates an alternative for fixture union `param_union_name`, to handle single parameter value
@@ -424,7 +424,7 @@ def create(cls,
424424
ids: Union[Sequence[str], Callable],
425425
scope: str = "function",
426426
hook: Callable = None,
427-
debug: bool = False
427+
debug: bool = False
428428
) -> 'MultiParamAlternative':
429429
"""
430430
Creates an alternative for fixture union `param_union_name`, to handle a group of consecutive parameters

src/pytest_cases/pep380.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def wrapped_fixture_func(*args, **kwargs):
2020

2121
return wrapped_fixture_func
2222

23+
2324
def _decorate_fixture_plus_generator_pep380(fixture_func, new_sig, map_arguments):
2425
@wraps(fixture_func, new_sig=new_sig)
2526
def wrapped_fixture_func(*_args, **_kwargs):
@@ -31,6 +32,7 @@ def wrapped_fixture_func(*_args, **_kwargs):
3132

3233
return wrapped_fixture_func
3334

35+
3436
def _parametrize_plus_decorate_generator_pep380(
3537
test_func,
3638
new_sig,

src/pytest_cases/pep492.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ async def wrapped_fixture_func(*args, **kwargs):
2020

2121
return wrapped_fixture_func
2222

23+
2324
def _decorate_fixture_plus_coroutine_pep492(fixture_func, new_sig, map_arguments):
2425
@wraps(fixture_func, new_sig=new_sig)
2526
async def wrapped_fixture_func(*_args, **_kwargs):

src/pytest_cases/pep525.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ async def wrapped_fixture_func(*args, **kwargs):
2121

2222
return wrapped_fixture_func
2323

24+
2425
def _decorate_fixture_plus_asyncgen_pep525(fixture_func, new_sig, map_arguments):
2526
@wraps(fixture_func, new_sig=new_sig)
2627
async def wrapped_fixture_func(*_args, **_kwargs):
@@ -33,6 +34,7 @@ async def wrapped_fixture_func(*_args, **_kwargs):
3334

3435
return wrapped_fixture_func
3536

37+
3638
def _parametrize_plus_decorate_asyncgen_pep525(
3739
test_func,
3840
new_sig,

0 commit comments

Comments
 (0)