Skip to content

Commit ce34ffe

Browse files
committed
Fixed output processor test
1 parent d9ea29c commit ce34ffe

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

jupyter_server_documents/tests/test_output_processor.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
import json
2+
import pytest
23
from pathlib import Path
34
from tempfile import TemporaryDirectory
45
from uuid import uuid4
56

67
from ..outputs import OutputProcessor, OutputsManager
78

8-
class TestOutputProcessor(OutputProcessor):
9+
class OutputProcessorForTest(OutputProcessor):
10+
"""Test subclass of OutputProcessor that overrides the settings property."""
11+
_test_settings = {}
912

10-
settings = {}
13+
@property
14+
def settings(self):
15+
"""Override the settings property to return a test dictionary."""
16+
return self._test_settings
17+
18+
@pytest.fixture
19+
def output_processor():
20+
"""Fixture that returns an instance of TestOutputProcessor."""
21+
return OutputProcessorForTest()
1122

1223
def create_incoming_message(cell_id):
1324
msg_id = str(uuid4())
@@ -17,9 +28,9 @@ def create_incoming_message(cell_id):
1728
msg = [json.dumps(item) for item in [header, parent_header, metadata]]
1829
return msg_id, msg
1930

20-
def test_instantiation():
31+
def test_instantiation(output_processor):
2132
"""Test instantiation of the output processor."""
22-
op = OutputProcessor()
33+
op = output_processor
2334
assert isinstance(op, OutputProcessor)
2435

2536
# TODO: Implement this

jupyter_server_documents/tests/test_yroom_file_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ async def test_load_plaintext_file(plaintext_file_api: Awaitable[YRoomFileAPI],
7474
file_api = await plaintext_file_api
7575
jupyter_ydoc = file_api.jupyter_ydoc
7676
file_api.load_ydoc_content()
77-
await asyncio.wait_for(file_api.ydoc_content_loaded.wait(), 2)
77+
await file_api.ydoc_content_loaded.wait()
7878

7979
# Assert that `get_jupyter_ydoc()` returns a `jupyter_ydoc.YUnicode` object
8080
# for plaintext files

0 commit comments

Comments
 (0)