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

netzkolchose / django-computedfields / 16455249646

22 Jul 2025 08:51PM UTC coverage: 94.364% (-0.8%) from 95.192%
16455249646

Pull #189

github

web-flow
Merge 0815c23a9 into f018eaa24
Pull Request #189: autorecover for not_computed context

517 of 566 branches covered (91.34%)

Branch coverage included in aggregate %.

113 of 124 new or added lines in 4 files covered. (91.13%)

5 existing lines in 1 file now uncovered.

1241 of 1297 relevant lines covered (95.68%)

11.48 hits per line

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

94.87
/computedfields/thread_locals.py
1
from threading import local
12✔
2

3
from typing import TYPE_CHECKING, Optional
12✔
4
if TYPE_CHECKING:
12!
NEW
5
    from .resolver import NotComputed
×
6

7

8
_STORAGE = local()
12✔
9

10
# thread local storage to hold pk lists
11
# for deletes/updates from signal handlers
12

13
def get_DELETES():
12✔
14
    try:
12✔
15
        return _STORAGE.DELETES
12✔
16
    except AttributeError:
12✔
17
        _STORAGE.DELETES = {}
12✔
18
    return _STORAGE.DELETES
12✔
19

20
def get_M2M_REMOVE():
12✔
21
    try:
12✔
22
        return _STORAGE.M2M_REMOVE
12✔
23
    except AttributeError:
12✔
24
        _STORAGE.M2M_REMOVE = {}
12✔
25
    return _STORAGE.M2M_REMOVE
12✔
26

27
def get_M2M_CLEAR():
12✔
28
    try:
12✔
29
        return _STORAGE.M2M_CLEAR
12✔
30
    except AttributeError:
12✔
31
        _STORAGE.M2M_CLEAR = {}
12✔
32
    return _STORAGE.M2M_CLEAR
12✔
33

34
def get_UPDATE_OLD():
12✔
35
    try:
12✔
36
        return _STORAGE.UPDATE_OLD
12✔
37
    except AttributeError:
12✔
38
        _STORAGE.UPDATE_OLD = {}
12✔
39
    return _STORAGE.UPDATE_OLD
12✔
40

41

42
# get/set not_computed context
43
def get_not_computed_context() -> Optional['NotComputed']:
12✔
44
    try:
12✔
45
        return _STORAGE.not_computed_context
12✔
46
    except AttributeError:
12✔
47
        _STORAGE.not_computed_context = None
12✔
48
    return _STORAGE.not_computed_context
12✔
49

50
def set_not_computed_context(ctx: Optional['NotComputed'] = None):
12✔
51
    _STORAGE.not_computed_context = ctx
12✔
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

© 2026 Coveralls, Inc