push
github
27 of 126 branches covered (21.43%)
Branch coverage included in aggregate %.
1 of 1 new or added line in 1 file covered. (100.0%)
1143 existing lines in 77 files now uncovered.981 of 2254 relevant lines covered (43.52%)
0.44 hits per line
1 |
import threading |
1✔ |
2 |
from .writer import writer |
1✔ |
3 |
from .writable import writable |
1✔ |
4 |
|
|
5 |
class std_out_writer(writer): |
1✔ |
6 |
__counter_lock = threading.Lock() |
1✔ |
7 |
__message_counter = 0
|
1✔ |
8 |
|
|
9 |
def __init__(self): |
1✔ |
UNCOV
10
|
self.__lock = threading.Lock()
|
× |
11 |
|
|
12 |
def write(self, to_write: writable) -> None: |
1✔ |
UNCOV
13
|
with self.__lock: |
× |
UNCOV
14
|
print(to_write.to_json()) |
× |
UNCOV
15
|
self.__update_counter()
|
× |
16 |
|
|
17 |
@classmethod
|
1✔ |
18 |
def __update_counter(cls): |
1✔ |
UNCOV
19
|
with cls.__counter_lock:
|
× |
UNCOV
20
|
cls.__message_counter += 1
|
× |
UNCOV
21
|
print(f"Total messages printed: {cls.__message_counter}")
|
× |