Skip to content

Commit

Permalink
Fixed test configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
vladvildanov committed Dec 13, 2024
1 parent d3d1879 commit bc31898
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:

concurrency:
group: ${{ github.event.pull_request.number || github.ref }}-tests
cancel-in-progress: true

permissions:
contents: read
Expand Down
14 changes: 7 additions & 7 deletions tests/test_cred_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async def test_get_credentials_async(self, credential_provider: EntraIdCredentia
"credential_provider",
[
{
"cred_provider_kwargs": {"expiration_refresh_ratio": 0.00001},
"cred_provider_kwargs": {"expiration_refresh_ratio": 0.00005},
}
],
indirect=True,
Expand All @@ -58,7 +58,7 @@ def on_next(token: TokenInterface):
"credential_provider",
[
{
"cred_provider_kwargs": {"expiration_refresh_ratio": 0.00001},
"cred_provider_kwargs": {"expiration_refresh_ratio": 0.00005},
}
],
indirect=True,
Expand All @@ -75,15 +75,15 @@ def on_next(token: TokenInterface):

# Run token manager
await credential_provider.get_credentials_async()
await asyncio.sleep(0.3)
await asyncio.sleep(0.5)

assert len(tokens) == 1

@pytest.mark.parametrize(
"credential_provider",
[
{
"cred_provider_kwargs": {"expiration_refresh_ratio": 0.00001},
"cred_provider_kwargs": {"expiration_refresh_ratio": 0.00005},
}
],
indirect=True,
Expand All @@ -104,7 +104,7 @@ def on_error(error: Exception):

# Run token manager
credential_provider.get_credentials()
sleep(0.3)
sleep(0.5)

assert len(errors) == 1
assert str(errors[0]) == "Some exception"
Expand All @@ -113,7 +113,7 @@ def on_error(error: Exception):
"credential_provider",
[
{
"cred_provider_kwargs": {"expiration_refresh_ratio": 0.00001},
"cred_provider_kwargs": {"expiration_refresh_ratio": 0.00005},
}
],
indirect=True,
Expand All @@ -135,7 +135,7 @@ async def on_error(error: Exception):

# Run token manager
await credential_provider.get_credentials_async()
await asyncio.sleep(0.3)
await asyncio.sleep(0.5)

assert len(errors) == 1
assert str(errors[0]) == "Some exception"

0 comments on commit bc31898

Please sign in to comment.