Skip to content

Commit 8a607cd

Browse files
committed
refactor: fix a few details to please flake8
1 parent 3269efd commit 8a607cd

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

batchspawner/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from .batchspawner import *
2-
from ._version import __version__, version_info
3-
from . import api
1+
from . import api # noqa
2+
from ._version import __version__, version_info # noqa
3+
from .batchspawner import * # noqa

batchspawner/singleuser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ def main(argv=None):
2727
if hub_auth.client_ca:
2828
kwargs["verify"] = hub_auth.client_ca
2929

30-
r = requests.post(
30+
requests.post(
3131
url,
32-
headers={"Authorization": f"token {hub_auth.api_token}"},
32+
headers=headers,
3333
json={"port": port},
3434
**kwargs,
3535
)

batchspawner/tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
# We only use "db" and "io_loop", but we also need event_loop which is used by
44
# io_loop to be available with jupyterhub 1+.
5-
from jupyterhub.tests.conftest import db, io_loop
5+
from jupyterhub.tests.conftest import db, io_loop # noqa
66

77
try:
8-
from jupyterhub.tests.conftest import event_loop
8+
from jupyterhub.tests.conftest import event_loop # noqa
99
except:
1010
pass

batchspawner/tests/test_spawners.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def test_submit_failure(db, io_loop):
131131
spawner = new_spawner(db=db)
132132
assert spawner.get_state() == {}
133133
spawner.batch_submit_cmd = "cat > /dev/null; true"
134-
with pytest.raises(RuntimeError) as e_info:
134+
with pytest.raises(RuntimeError):
135135
io_loop.run_sync(spawner.start, timeout=30)
136136
assert spawner.job_id == ""
137137
assert spawner.job_status == ""
@@ -142,7 +142,7 @@ def test_submit_pending_fails(db, io_loop):
142142
spawner = new_spawner(db=db)
143143
assert spawner.get_state() == {}
144144
spawner.batch_query_cmd = "echo xyz"
145-
with pytest.raises(RuntimeError) as e_info:
145+
with pytest.raises(RuntimeError):
146146
io_loop.run_sync(spawner.start, timeout=30)
147147
status = io_loop.run_sync(spawner.query_job_status, timeout=30)
148148
assert status == JobStatus.NOTFOUND

0 commit comments

Comments
 (0)