GeezerVison is showing github.com — marking lines that only run in py3.5 · benthomasson/deepdiff@1c5e4cc
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: deepdiff/helper.py +12-8Lines changed: 12 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -90,23 +90,27 @@ class np_type: |
90 | 90 |
|
91 | 91 |
|
92 | 92 | class OrderedDictPlus(OrderedDict): |
| 93 | + """ |
| 94 | + This class is only used when a python version is used where |
| 95 | + the built-in dictionary is not ordered. |
| 96 | + """ |
93 | 97 |
|
94 | | - def __repr__(self): |
95 | | - return str(dict(self)) |
| 98 | + def __repr__(self): # pragma: no cover. Only used in pypy3 and py3.5 |
| 99 | + return str(dict(self)) # pragma: no cover. Only used in pypy3 and py3.5 |
96 | 100 |
|
97 | 101 | __str__ = __repr__ |
98 | 102 |
|
99 | | - def copy(self): |
100 | | - result = OrderedDictPlus() |
101 | | - for k, v in self.items(): |
102 | | - result[k] = v |
103 | | - return result |
| 103 | + def copy(self): # pragma: no cover. Only used in pypy3 and py3.5 |
| 104 | + result = OrderedDictPlus() # pragma: no cover. Only used in pypy3 and py3.5 |
| 105 | + for k, v in self.items(): # pragma: no cover. Only used in pypy3 and py3.5 |
| 106 | + result[k] = v # pragma: no cover. Only used in pypy3 and py3.5 |
| 107 | + return result # pragma: no cover. Only used in pypy3 and py3.5 |
104 | 108 |
|
105 | 109 |
|
106 | 110 | if DICT_IS_SORTED: |
107 | 111 | dict_ = dict |
108 | 112 | else: |
109 | | - dict_ = OrderedDictPlus |
| 113 | + dict_ = OrderedDictPlus # pragma: no cover. Only used in pypy3 and py3.5 |
110 | 114 |
|
111 | 115 |
|
112 | 116 | if py4: |
|