Skip to content

Commit 507865f

Browse files
committed
Fixed await async warnings
1 parent 9f20813 commit 507865f

File tree

2 files changed

+45
-6
lines changed

2 files changed

+45
-6
lines changed

.github/workflows/test.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: select_ai_py_tests
2+
on: push
3+
4+
jobs:
5+
select_ai_py_tests:
6+
runs-on: ${{ matrix.os }}
7+
strategy:
8+
fail-fast: true
9+
matrix:
10+
os: [ ubuntu-latest ]
11+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
12+
13+
steps:
14+
- name: Check out python-select-ai repository code
15+
uses: actions/checkout@v5
16+
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v6
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: Install select_ai with core dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install pytest anyio
26+
pip install -e .
27+
28+
- name: Run select_ai tests
29+
run: |
30+
pytest -vv
31+
env:
32+
PYSAI_TEST_USER: ${{ secrets.PYSAI_TEST_USER }}
33+
PYSAI_TEST_USER_PASSWORD: ${{ secrets.PYSAI_TEST_USER_PASSWORD }}
34+
PYSAI_TEST_ADMIN_USER: ${{ secrets.PYSAI_TEST_ADMIN_USER }}
35+
PYSAI_TEST_ADMIN_PASSWORD: ${{ secrets.PYSAI_TEST_ADMIN_PASSWORD }}
36+
PYSAI_TEST_CONNECT_STRING: ${{ secrets.PYSAI_TEST_CONNECT_STRING }}
37+
PYSAI_TEST_OCI_USER_OCID: ${{ secrets.PYSAI_TEST_OCI_USER_OCID }}
38+
PYSAI_TEST_OCI_TENANCY_OCID: ${{ secrets.PYSAI_TEST_OCI_TENANCY_OCID }}
39+
PYSAI_TEST_OCI_PRIVATE_KEY: ${{ secrets.PYSAI_TEST_OCI_PRIVATE_KEY }}
40+
PYSAI_TEST_OCI_FINGERPRINT: ${{ secrets.PYSAI_TEST_OCI_FINGERPRINT }}
41+
PYSAI_TEST_OCI_COMPARTMENT_ID: ${{ secrets.PYSAI_TEST_OCI_COMPARTMENT_ID }}

tests/test_1300_profile_async.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,14 @@ def test_1303(python_gen_ai_min_attr_profile, min_profile_attributes):
121121

122122
async def test_1304():
123123
"""List profiles without regex"""
124-
profile_list = [
125-
profile.profile_name async for profile in AsyncProfile.list()
126-
]
124+
profile_list = [await profile async for profile in AsyncProfile.list()]
127125
assert len(profile_list) == 3
128126

129127

130128
async def test_1305():
131129
"""List profiles with regex"""
132130
profile_list = [
133-
profile
131+
await profile
134132
async for profile in AsyncProfile.list(
135133
profile_name_pattern=".*PROFILE$"
136134
)
@@ -157,7 +155,7 @@ async def test_1307():
157155

158156
async def test_1308(oci_credential):
159157
"""Set multiple attributes for a Profile"""
160-
profile = AsyncProfile("PYTHON_GENAI_PROFILE")
158+
profile = await AsyncProfile("PYTHON_GENAI_PROFILE")
161159
profile_attrs = ProfileAttributes(
162160
credential_name=oci_credential["credential_name"],
163161
provider=select_ai.OCIGenAIProvider(),
@@ -248,7 +246,7 @@ async def test_1314():
248246
# expected - ORA-12726: unmatched bracket in regular expression
249247
with pytest.raises(oracledb.DatabaseError):
250248
profiles = [
251-
profile
249+
await profile
252250
async for profile in AsyncProfile.list(
253251
profile_name_pattern="[*invalid"
254252
)

0 commit comments

Comments
 (0)