Skip to content

Commit

Permalink
Merge pull request #73 from pymeasure/bump-codecov
Browse files Browse the repository at this point in the history
Bump codedov version
  • Loading branch information
BenediktBurger authored Apr 30, 2024
2 parents 9bd20f7 + ce9f380 commit c66873a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/pyleco_CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,9 @@ jobs:
- name: Test for Coverage
run: pytest --cov=pyleco --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/reports/
# env_vars: OS,PYTHON
fail_ci_if_error: true
files: ./coverage.xml,!./cache
flags: unittests
Expand Down
2 changes: 1 addition & 1 deletion pyleco/utils/communicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def poll(self, timeout: Optional[float] = None) -> int:
"""Check how many messages arrived."""
if timeout is None:
timeout = self.timeout
return self.socket.poll(timeout=timeout * 1000) # in ms
return self.socket.poll(timeout=int(timeout * 1000)) # in ms

def handle_not_signed_in(self):
super().handle_not_signed_in()
Expand Down
10 changes: 5 additions & 5 deletions pyleco/utils/coordinator_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def close(self, timeout: int) -> None: ... # pragma: no cover
def send_message(self, identity: bytes, message: Message) -> None: ... # pragma: no cover

@abstractmethod
def message_received(self, timeout: float = 0) -> bool: ... # pragma: no cover
def message_received(self, timeout: int = 0) -> bool: ... # pragma: no cover

@abstractmethod
def read_message(self) -> tuple[bytes, Message]: ... # pragma: no cover
Expand Down Expand Up @@ -100,7 +100,7 @@ def close(self, timeout: int = 0) -> None:
def send_message(self, identity: bytes, message: Message) -> None:
self._sock.send_multipart((identity, *message.to_frames()))

def message_received(self, timeout: float = 0) -> bool:
def message_received(self, timeout: int = 0) -> bool:
return bool(self._sock.poll(timeout=timeout))

def read_message(self) -> tuple[bytes, Message]:
Expand All @@ -126,7 +126,7 @@ def close(self, timeout: int) -> None:
def send_message(self, identity: bytes, message: Message) -> None:
self._messages_sent.append((identity, message))

def message_received(self, timeout: float = 0) -> bool:
def message_received(self, timeout: int = 0) -> bool:
return len(self._messages_read) > 0 # pragma: no cover

def read_message(self) -> tuple[bytes, Message]:
Expand Down Expand Up @@ -162,7 +162,7 @@ def is_connected(self) -> bool:
def send_message(self, message: Message) -> None:
raise NotImplementedError("Implement in subclass") # pragma: no cover

def message_received(self, timeout: float = 0) -> bool:
def message_received(self, timeout: int = 0) -> bool:
raise NotImplementedError("Implement in subclass") # pragma: no cover

def read_message(self, timeout: int = 0) -> Message:
Expand Down Expand Up @@ -200,7 +200,7 @@ def send_message(self, message: Message) -> None:
"""Send a multipart message to the Coordinator."""
self._dealer.send_multipart(message.to_frames())

def message_received(self, timeout: float = 0) -> bool:
def message_received(self, timeout: int = 0) -> bool:
return bool(self._dealer.poll(timeout=timeout))

def read_message(self, timeout: int = 0) -> Message:
Expand Down

0 comments on commit c66873a

Please sign in to comment.