Skip to content

Run Session class tests in an event loop #881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
2.0.0-rc.3 (TBD)

Changed:
- Session class unit tests are marked to be run within an event loop and are
no longer skipped (#881).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change log updated


2.0.0-rc.2 (2023-03-15)

Added:
- The Session class can now construct clients by name with its client method
(#858).

Changed:
- Updated product bundle spec to 2/24/23 version.
- `planet.subscription_request.catalog_source` and
`planet subscriptions source-catalog` now simplify geojson given in
`geometry` parameter/option to just the geometry, the form required by the
subscriptions api (#880).


2.0.0-rc.1 (2023-03-06)
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from planet.exceptions import ClientError


@pytest.mark.asyncio
@pytest.mark.parametrize("client_name,client_class",
[('data', DataClient), ('orders', OrdersClient),
('subscriptions', SubscriptionsClient)])
Expand All @@ -16,6 +17,7 @@ async def test_session_get_client(client_name, client_class):
assert isinstance(client, client_class)


@pytest.mark.asyncio
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I lost these along the way. It would have helped if pytest failed instead of skipping. Maybe we can configure it to do so. I don't immediately see how, it seems particular to async functions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed. will keep an eye out for a way to do this.

async def test_session_get_client_error():
"""Get an exception when no such client exists."""
async with Session() as session:
Expand Down