Skip to content

Commit

Permalink
Fix flake8 errors and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ppigazzini committed Apr 17, 2024
1 parent 847a634 commit 1c56905
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
1 change: 0 additions & 1 deletion server/fishtest/actiondb.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from datetime import datetime, timezone

from bson.objectid import ObjectId
from fishtest.schemas import action_schema
from fishtest.util import hex_print, worker_name
from pymongo import DESCENDING
Expand Down
6 changes: 3 additions & 3 deletions server/fishtest/userdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import time
from datetime import datetime, timezone

from bson.objectid import ObjectId
from fishtest.schemas import user_schema
from pymongo import ASCENDING
from vtjson import ValidationError, validate
Expand All @@ -15,8 +14,9 @@ def validate_user(user):
try:
validate(user_schema, user, "user")
except ValidationError as e:
print(valid, flush=True)
raise
message = f"The user object does not validate: {str(e)}"
print(message, flush=True)
raise Exception(message)


class UserDb:
Expand Down
2 changes: 1 addition & 1 deletion server/fishtest/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ def parse_spsa_params(raw, spsa):


def validate_modify(request, run):
if not "num-games" in request.POST:
if "num-games" not in request.POST:
request.session.flash("Unable to modify with no number of games!", "error")
raise home(request)

Expand Down
3 changes: 1 addition & 2 deletions server/fishtest/workerdb.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from datetime import datetime, timezone

from bson.objectid import ObjectId
from fishtest.schemas import worker_schema
from vtjson import regex, validate
from vtjson import validate


class WorkerDb:
Expand Down
6 changes: 3 additions & 3 deletions server/tests/test_nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ def setUp(self):
self.rundb = get_rundb()
self.name = "nn-0000000000a0.nnue"
self.user = "user00"
self.first_test = datetime(2024, 1, 1)
self.last_test = datetime(2024, 3, 24)
self.last_test_old = datetime(2023, 3, 24)
self.first_test = datetime(2024, 1, 1, tzinfo=timezone.utc)
self.last_test = datetime(2024, 3, 24, tzinfo=timezone.utc)
self.last_test_old = datetime(2023, 3, 24, tzinfo=timezone.utc)
self.run_id = "64e74776a170cb1f26fa3930"

def tearDown(self):
Expand Down

0 comments on commit 1c56905

Please sign in to comment.