[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot]
2023-05-15 08:51:35 +00:00
parent b366d6b63f
commit e95942d61b
32 changed files with 93 additions and 107 deletions

View File

@@ -1,8 +1,9 @@
from hubtraf.user import User
from hubtraf.auth.dummy import login_dummy
import pytest
from functools import partial
import pytest
from hubtraf.auth.dummy import login_dummy
from hubtraf.user import User
@pytest.mark.asyncio
async def test_admin_login():

View File

@@ -162,7 +162,7 @@ def verify_progress_page(expected_status_code, timeout):
if b"HTTP/1.0 200 OK" in resp:
progress_page_status = True
break
except Exception as e:
except Exception:
time.sleep(2)
continue

View File

@@ -1,18 +1,20 @@
import requests
from hubtraf.user import User
from hubtraf.auth.dummy import login_dummy
from jupyterhub.utils import exponential_backoff
import secrets
import pytest
from functools import partial
import asyncio
import pwd
import grp
import pwd
import secrets
import subprocess
from functools import partial
from os import system
from tljh.normalize import generate_system_username
import pytest
import requests
from hubtraf.auth.dummy import login_dummy
from hubtraf.user import User
from jupyterhub.utils import exponential_backoff
from packaging.version import Version as V
from tljh.normalize import generate_system_username
# Use sudo to invoke it, since this is how users invoke it.
# This catches issues with PATH
TLJH_CONFIG_PATH = ["sudo", "tljh-config"]

View File

@@ -1,15 +1,14 @@
from contextlib import contextmanager
from concurrent.futures import ProcessPoolExecutor
from functools import partial
import grp
import os
import pwd
import subprocess
import sys
from concurrent.futures import ProcessPoolExecutor
from contextlib import contextmanager
from functools import partial
import pytest
ADMIN_GROUP = "jupyterhub-admins"
USER_GROUP = "jupyterhub-users"
INSTALL_PREFIX = os.environ.get("TLJH_INSTALL_PREFIX", "/opt/tljh")

View File

@@ -2,19 +2,19 @@
import os
import shutil
import ssl
from subprocess import check_call
import time
from subprocess import check_call
import toml
from tornado.httpclient import HTTPClient, HTTPRequest, HTTPClientError
import pytest
import toml
from tornado.httpclient import HTTPClient, HTTPClientError, HTTPRequest
from tljh.config import (
CONFIG_DIR,
CONFIG_FILE,
STATE_DIR,
reload_component,
set_config_value,
CONFIG_FILE,
CONFIG_DIR,
STATE_DIR,
)
@@ -36,7 +36,6 @@ def send_request(url, max_sleep, validate_cert=True, username=None, password=Non
break
except Exception as e:
print(e)
pass
return resp
@@ -134,7 +133,7 @@ def test_extra_traefik_config():
HTTPClient().fetch(req)
success = True
break
except Exception as e:
except Exception:
pass
assert success == True

View File

@@ -1,13 +1,14 @@
"""
Test simplest plugin
"""
from ruamel.yaml import YAML
import requests
import os
import subprocess
from tljh.config import CONFIG_FILE, USER_ENV_PREFIX, HUB_ENV_PREFIX
import requests
from ruamel.yaml import YAML
from tljh import user
from tljh.config import CONFIG_FILE, HUB_ENV_PREFIX, USER_ENV_PREFIX
yaml = YAML(typ="rt")