Skip to content

Commit

Permalink
test: try adding coverage for QThread
Browse files Browse the repository at this point in the history
  • Loading branch information
kmnhan committed Jun 18, 2024
1 parent ff70cd9 commit caf08f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ exclude_also = [
"if __name__ == __main__:",
"except varname.VarnameRetrievingError:",
"if TYPE_CHECKING:",
"QtCore.QThread",
# "QtCore.QThread",
]

[tool.mypy]
Expand Down
3 changes: 3 additions & 0 deletions src/erlab/interactive/imagetool/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ def __init__(self):
self.stopped = threading.Event()

def run(self):
if threading._trace_hook:
sys.settrace(threading._trace_hook) # For test coverage

self.stopped.clear()
soc = socket.socket()
soc.bind(("127.0.0.1", PORT))
Expand Down

0 comments on commit caf08f5

Please sign in to comment.