Skip to content

Commit

Permalink
Fix utc calling error
Browse files Browse the repository at this point in the history
  • Loading branch information
soapy1 committed Oct 25, 2024
1 parent d82b336 commit 567e959
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion conda-store-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ See the [documentation](https://conda.store/) for more information.

### Run tests with pytest
```
$ python -m pytest -m "not extended_prefix and not user_journey" tests/
# ignoring integration tests
$ python -m pytest -m "not extended_prefix and not user_journey" tests/
# ignoring long running tests
$ python -m pytest -m "not extended_prefix and not user_journey and not long_running_test" tests/
```

### Run tests with code coverage
Expand Down
6 changes: 3 additions & 3 deletions conda-store-server/conda_store_server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ def delete_namespace(self, db: Session, namespace: str):
if namespace is None:
raise utils.CondaStoreError(f"namespace={namespace} does not exist")

utcnow = datetime.datetime.now(datetime.UTC)()
utcnow = datetime.datetime.now(datetime.UTC)
namespace.deleted_on = utcnow
for environment_orm in namespace.environments:
environment_orm.deleted_on = utcnow
Expand Down Expand Up @@ -852,7 +852,7 @@ def delete_environment(self, db: Session, namespace: str, name: str):
f"environment namespace={namespace} name={name} does not exist"
)

utcnow = datetime.datetime.now(datetime.UTC)()
utcnow = datetime.datetime.now(datetime.UTC)
environment.deleted_on = utcnow
for build in environment.builds:
build.deleted_on = utcnow
Expand Down Expand Up @@ -883,7 +883,7 @@ def delete_build(self, db: Session, build_id: int):
"cannot delete build since not finished building"
)

build.deleted_on = datetime.datetime.now(datetime.UTC)()
build.deleted_on = datetime.datetime.now(datetime.UTC)
db.commit()

self.celery_app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ def test_create_namespace_auth(testclient, authenticate):
assert r.data.name == namespace


def test_create_get_delete_namespace_auth(testclient, celery_sesssion_worker, authenticate):
def test_create_get_delete_namespace_auth(testclient, celery_session_worker, authenticate):
namespace = "pytest-delete-namespace"

response = testclient.post(f"api/v1/namespace/{namespace}")
Expand Down

0 comments on commit 567e959

Please sign in to comment.