• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

oauthlib / oauthlib / 17025260387

17 Aug 2025 08:01PM UTC coverage: 92.846% (-0.06%) from 92.909%
17025260387

push

github

web-flow
Merge pull request #918 from cclauss/pre-commit

Add pre-commit to run linters, formatters, etc. on code changes

979 of 1089 branches covered (89.9%)

Branch coverage included in aggregate %.

3109 of 3314 relevant lines covered (93.81%)

5.61 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

30.0
/oauthlib/signals.py
1
"""
2
    Implements signals based on blinker if available, otherwise
3
    falls silently back to a noop. Shamelessly stolen from flask.signals:
4
    https://github.com/mitsuhiko/flask/blob/master/flask/signals.py
5
"""
6
signals_available = False
6✔
7
try:
6✔
8
    from blinker import Namespace
6✔
9
    signals_available = True
6✔
10
except ImportError:
×
11
    class Namespace:
×
12
        def signal(self, name, doc=None):
×
13
            return _FakeSignal(name, doc)
×
14

15
    class _FakeSignal:
×
16
        """If blinker is unavailable, create a fake class with the same
17
        interface that allows sending of signals but will fail with an
18
        error on anything else.  Instead of doing anything on send, it
19
        will just ignore the arguments and do nothing instead.
20
        """
21

22
        def __init__(self, name, doc=None):
×
23
            self.name = name
×
24
            self.__doc__ = doc
×
25
        def _fail(self, *args, **kwargs):
×
26
            raise RuntimeError('signalling support is unavailable '
×
27
                               'because the blinker library is '
28
                               'not installed.')
29
        def send(*a, **kw):
×
30
            return None
×
31
        connect = disconnect = has_receivers_for = receivers_for = \
×
32
            temporarily_connected_to = connected_to = _fail
33
        del _fail
×
34

35
# The namespace for code signals.  If you are not oauthlib code, do
36
# not put signals in here.  Create your own namespace instead.
37
_signals = Namespace()
6✔
38

39

40
# Core signals.
41
scope_changed = _signals.signal('scope-changed')
6✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc