Skip to content

Commit

Permalink
fix pytest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-i committed May 9, 2024
1 parent a6b75ed commit 9d41103
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jupyter_scheduler/tests/mocks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from multiprocessing import Queue
from typing import Dict, List
from unittest.mock import Mock

from jupyter_scheduler.download_manager import DownloadManager
from jupyter_scheduler.environments import EnvironmentManager
Expand Down Expand Up @@ -78,4 +80,4 @@ def resume_jobs(self, job_definition_id: str):

class MockDownloadManager(DownloadManager):
def __init__(self, db_url: str):
pass
self.queue = Queue()
3 changes: 3 additions & 0 deletions jupyter_scheduler/tests/test_execution_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from conftest import DB_URL
from jupyter_scheduler.executors import DefaultExecutionManager
from jupyter_scheduler.orm import Job
from jupyter_scheduler.tests.mocks import MockDownloadManager

JOB_ID = "69856f4e-ce94-45fd-8f60-3a587457fce7"
NOTEBOOK_NAME = "side_effects.ipynb"
Expand All @@ -30,11 +31,13 @@ def load_job(jp_scheduler_db):


def test_add_side_effects_files(jp_scheduler_db, load_job):
download_manager = MockDownloadManager(DB_URL)
manager = DefaultExecutionManager(
job_id=JOB_ID,
root_dir=str(NOTEBOOK_DIR),
db_url=DB_URL,
staging_paths={"input": str(NOTEBOOK_PATH)},
download_queue=download_manager.queue,
)
manager.add_side_effects_files(str(NOTEBOOK_DIR))

Expand Down

0 comments on commit 9d41103

Please sign in to comment.