Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 19, 2024
1 parent dcd6393 commit 3f3b931
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/apscheduler/_schedulers/async_.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,15 @@ async def configure_task(
metadata=task.metadata,
)
except TaskLookupError:
task_params = get_task_params(func) if callable(func) else TaskParameters()
task_params = (
get_task_params(func) if callable(func) else TaskParameters()
)
task_params.id = func_or_task_id
else:
raise TypeError(
"func_or_task_id must be either a task, its identifier or a callable"
)

assert task_params.id

# Apply any settings passed directly to this function as arguments
Expand Down
10 changes: 6 additions & 4 deletions tests/test_schedulers.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,13 +761,15 @@ async def test_add_job_get_result_no_ready_yet(self) -> None:
with pytest.raises(JobLookupError), fail_after(1):
await scheduler.get_job_result(job_id, wait=False)

async def test_add_job_not_rewriting_task_config(self, raw_datastore: DataStore) -> None:
async def test_add_job_not_rewriting_task_config(
self, raw_datastore: DataStore
) -> None:
async with AsyncScheduler(data_store=raw_datastore) as scheduler:
TASK_ID = 'task_dummy_async_job'
JOB_EXECUTOR = 'async'
TASK_ID = "task_dummy_async_job"
JOB_EXECUTOR = "async"
MISFIRE_GRACE_TIME = timedelta(seconds=10)
MAX_RUNNING_JOBS = 5
METADATA = {'key': 'value'}
METADATA = {"key": "value"}

await scheduler.configure_task(
func_or_task_id=TASK_ID,
Expand Down

0 comments on commit 3f3b931

Please sign in to comment.