Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
eleanorjboyd committed Oct 1, 2024
1 parent a1383db commit 1c20390
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 21 deletions.
4 changes: 1 addition & 3 deletions python_files/tests/pytestadapter/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def process_data_received(data: str) -> List[Dict[str, Any]]:
This function also:
- Checks that the jsonrpc value is 2.0
- Checks that the last JSON message contains the `eot` token.
"""
json_messages = []
remaining = data
Expand All @@ -85,15 +84,14 @@ def process_data_received(data: str) -> List[Dict[str, Any]]:
else:
json_messages.append(json_data["params"])

return json_messages # return the list of json messages, only the params part without the EOT token
return json_messages # return the list of json messages


def parse_rpc_message(data: str) -> Tuple[Dict[str, str], str]:
"""Process the JSON data which comes from the server.
A single rpc payload is in the format:
content-length: #LEN# \r\ncontent-type: application/json\r\n\r\n{"jsonrpc": "2.0", "params": ENTIRE_DATA}
with EOT params: "params": {"command_type": "discovery", "eot": true}
returns:
json_data: A single rpc payload of JSON data from the server.
Expand Down
7 changes: 0 additions & 7 deletions python_files/unittestadapter/pvsc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,6 @@ class ExecutionPayloadDict(TypedDict):
error: NotRequired[str]


class EOTPayloadDict(TypedDict):
"""A dictionary that is used to send a end of transmission post request to the server."""

command_type: Literal["discovery", "execution"]
eot: bool


class FileCoverageInfo(TypedDict):
lines_covered: List[int]
lines_missed: List[int]
Expand Down
11 changes: 0 additions & 11 deletions python_files/vscode_pytest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,6 @@ def pytest_sessionfinish(session, exitstatus):
)
send_post_request(payload)

command_type = "discovery" if IS_DISCOVERY else "execution"
payload_eot: EOTPayloadDict = {"command_type": command_type, "eot": True}
send_post_request(payload_eot)


def build_test_tree(session: pytest.Session) -> TestNode:
"""Builds a tree made up of testing nodes from the pytest session.
Expand Down Expand Up @@ -782,13 +778,6 @@ class CoveragePayloadDict(Dict):
error: str | None # Currently unused need to check


class EOTPayloadDict(TypedDict):
"""A dictionary that is used to send a end of transmission post request to the server."""

command_type: Literal["discovery", "execution"]
eot: bool


def get_node_path(node: Any) -> pathlib.Path:
"""A function that returns the path of a node given the switch to pathlib.Path.
Expand Down

0 comments on commit 1c20390

Please sign in to comment.