Skip to content
This repository was archived by the owner on Mar 13, 2026. It is now read-only.

Commit 671d662

Browse files
committed
Install black
1 parent c514cb4 commit 671d662

4 files changed

Lines changed: 9 additions & 13 deletions

File tree

src/app.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
if hasattr(logging, loglevel_flask):
2525
loglevel_flask = getattr(logging, loglevel_flask)
2626
log.setLevel(loglevel_flask)
27-
logging.getLogger('apscheduler.executors.default').setLevel(logging.WARNING)
27+
logging.getLogger("apscheduler.executors.default").setLevel(logging.WARNING)
2828

2929
jobs = dict()
3030
job_handler = JobEventsHandler()
@@ -82,9 +82,7 @@ def process_workflow_job():
8282
app.logger.error(f"Job {job.id} was in progress before being queued")
8383
del jobs[job.id]
8484
else:
85-
time_to_start = (
86-
job.time_start - job_requested.time_start
87-
).seconds
85+
time_to_start = (job.time_start - job_requested.time_start).seconds
8886

8987
context_details = {
9088
**context_details,
@@ -105,9 +103,7 @@ def process_workflow_job():
105103
app.logger.warning(f"Job {job.id} is {job.action} but not stored!")
106104
time_to_finish = 0
107105
else:
108-
time_to_finish = (
109-
job.time_completed - job.time_start
110-
).seconds
106+
time_to_finish = (job.time_completed - job.time_start).seconds
111107
# delete from memory
112108
del jobs[job.id]
113109

@@ -129,7 +125,7 @@ def process_workflow_job():
129125
return True
130126

131127

132-
@scheduler.task('interval', id='monitor_queued', seconds=30)
128+
@scheduler.task("interval", id="monitor_queued", seconds=30)
133129
def monitor_queued_jobs():
134130
"""Return the job that has been queued and not starting for long time."""
135131
app.logger.debug("Starting monitor_queued_jobs")

src/github.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from utils import parse_datetime
22

33

4-
class GithubJob():
4+
class GithubJob:
55
def __init__(self, json_body: str):
66
self.data = json_body
77

tests/test_jobs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ def new_job_event():
1212

1313
@pytest.fixture
1414
def in_progress_job_event():
15-
return {"workflow_job": {"id": "workflow_id"}, "action": "in_progress"}
15+
return {"workflow_job": {"id": "workflow_id"}, "action": "in_progress"}
1616

1717

1818
@pytest.fixture
1919
def completed_job_event():
20-
return {"workflow_job": {"id": "workflow_id"}, "action": "completed"}
20+
return {"workflow_job": {"id": "workflow_id"}, "action": "completed"}
2121

2222

2323
def test_new_job(new_job_event):

tests/tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def test_method_not_allowed(client):
4141

4242

4343
def test_headers_not_correct(client, caplog):
44-
response = client.post(HOOK_ENDPOINT, headers={'User-Agent': 'foo'})
44+
response = client.post(HOOK_ENDPOINT, headers={"User-Agent": "foo"})
4545
assert response.status_code == 401
4646
assert caplog.messages == [
4747
"User-Agent is foo",
@@ -197,5 +197,5 @@ def test_line_break_in_job_name(client, caplog):
197197
assert caplog.messages == [
198198
'action=queued repository=foo/foo branch=new-feature-branch job_id=6 run_id=10 job_name="Build and push '
199199
'images (actions-runner-dind, NPROC=2 , runner-images/devops/actions-runner-dind, l..."'
200-
' workflow=CI requestor=testerbot'
200+
" workflow=CI requestor=testerbot"
201201
]

0 commit comments

Comments
 (0)