MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / check_decorator_order

Function check_decorator_order

diffusers/utils/check_repo.py:491–506  ·  view source on GitHub ↗

Check that in the test file `filename` the slow decorator is always last.

(filename)

Source from the content-addressed store, hash-verified

489
490
491def check_decorator_order(filename):
492 """Check that in the test file `filename` the slow decorator is always last."""
493 with open(filename, "r", encoding="utf-8", newline="\n") as f:
494 lines = f.readlines()
495 decorator_before = None
496 errors = []
497 for i, line in enumerate(lines):
498 search = _re_decorator.search(line)
499 if search is not None:
500 decorator_name = search.groups()[0]
501 if decorator_before is not None and decorator_name.startswith("parameterized"):
502 errors.append(i)
503 decorator_before = decorator_name
504 elif decorator_before is not None:
505 decorator_before = None
506 return errors
507
508
509def check_all_decorator_order():

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected