facelessuser / wcmatch
Showing 1 of 1 files from the diff.
Newly tracked file
wcmatch/util.py changed.

@@ -229,20 +229,24 @@
Loading
229 229
    """
230 230
    Raise a `DeprecationWarning` when wrapped function/method is called.
231 231
232 -
    Borrowed from https://stackoverflow.com/a/48632082/866026
232 +
    Usage:
233 +
234 +
        @deprecated("This method will be removed in version X; use Y instead.")
235 +
        def some_method()"
236 +
            pass
233 237
    """
234 238
235 -
    def _decorator(func):
239 +
    def _wrapper(func):
236 240
        @wraps(func)
237 -
        def _func(*args, **kwargs):
241 +
        def _deprecated_func(*args, **kwargs):
238 242
            warnings.warn(
239 -
                "'{}' is deprecated. {}".format(func.__name__, message),
243 +
                f"'{func.__name__}' is deprecated. {message}",
240 244
                category=DeprecationWarning,
241 245
                stacklevel=stacklevel
242 246
            )
243 247
            return func(*args, **kwargs)
244 -
        return _func
245 -
    return _decorator
248 +
        return _deprecated_func
249 +
    return _wrapper
246 250
247 251
248 252
def warn_deprecated(message, stacklevel=2):  # pragma: no cover
Files Coverage
wcmatch 100.00%
Project Totals (10 files) 100.00%
ubuntu-latest-py38
Build #1008252001 -
unittests
ubuntu-latest-py37
Build #1008252001 -
unittests
ubuntu-latest-py39
Build #1008252001 -
unittests
ubuntu-latest-py36
Build #1008252001 -
unittests
windows-latest-py38
Build #1008252001 -
unittests
ubuntu-latest-py310
Build #1008252001 -
unittests
windows-latest-py37
Build #1008252001 -
unittests
windows-latest-py36
Build #1008252001 -
unittests
windows-latest-py39
Build #1008252001 -
unittests
1
comment: false
2

3
coverage:
4
  status:
5
    patch: false
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading