Skip to content

Commit cfacbbc

Browse files
fix: tests and linting
1 parent c4948a2 commit cfacbbc

File tree

7 files changed

+9
-17
lines changed

7 files changed

+9
-17
lines changed

stream/client/client.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ def activity_partial_update(
169169
return self.activities_partial_update(updates=[data])
170170

171171
def activities_partial_update(self, updates=None):
172-
173172
auth_token = self.create_jwt_token("activities", "*", feed_id="*")
174173

175174
data = {"changes": updates or []}
@@ -195,7 +194,6 @@ def create_redirect_url(self, target_url, user_id, events):
195194
return prepared_request.url
196195

197196
def track_engagements(self, engagements):
198-
199197
auth_token = self.create_jwt_token("*", "*", feed_id="*")
200198
self.post(
201199
"engagement/",
@@ -205,7 +203,6 @@ def track_engagements(self, engagements):
205203
)
206204

207205
def track_impressions(self, impressions):
208-
209206
auth_token = self.create_jwt_token("*", "*", feed_id="*")
210207
self.post("impression/", auth_token, data=impressions, service_name="analytics")
211208

stream/collections/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ def delete(self, collection_name, id):
7272

7373

7474
class BaseCollection(AbstractCollection, ABC):
75-
7675
URL = "collections/"
7776
SERVICE_NAME = "api"
7877

stream/personalization/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ def delete(self, resource, **params):
1616

1717

1818
class BasePersonalization(AbstractPersonalization, ABC):
19-
2019
SERVICE_NAME = "personalization"
2120

2221
def __init__(self, client, token):

stream/reactions/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ def filter(self, **params):
4444

4545

4646
class BaseReactions(AbstractReactions, ABC):
47-
4847
API_ENDPOINT = "reaction/"
4948
SERVICE_NAME = "api"
5049

stream/tests/conftest.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import asyncio
22
import os
33
import sys
4+
import pytest_asyncio
45
from uuid import uuid4
56

6-
import pytest
77

88
from stream import connect
99

@@ -17,15 +17,15 @@ async def _parse_response(*args, **kwargs):
1717
return _parse_response
1818

1919

20-
@pytest.fixture(scope="module")
20+
@pytest_asyncio.fixture(scope="module")
2121
def event_loop():
2222
"""Create an instance of the default event loop for each test case."""
2323
loop = asyncio.get_event_loop_policy().new_event_loop()
2424
yield loop
2525
loop.close()
2626

2727

28-
@pytest.fixture
28+
@pytest_asyncio.fixture
2929
async def async_client():
3030
key = os.getenv("STREAM_KEY")
3131
secret = os.getenv("STREAM_SECRET")
@@ -44,31 +44,31 @@ async def async_client():
4444
yield client
4545

4646

47-
@pytest.fixture
47+
@pytest_asyncio.fixture
4848
def user1(async_client):
4949
return async_client.feed("user", f"1-{uuid4()}")
5050

5151

52-
@pytest.fixture
52+
@pytest_asyncio.fixture
5353
def user2(async_client):
5454
return async_client.feed("user", f"2-{uuid4()}")
5555

5656

57-
@pytest.fixture
57+
@pytest_asyncio.fixture
5858
def aggregated2(async_client):
5959
return async_client.feed("aggregated", f"2-{uuid4()}")
6060

6161

62-
@pytest.fixture
62+
@pytest_asyncio.fixture
6363
def aggregated3(async_client):
6464
return async_client.feed("aggregated", f"3-{uuid4()}")
6565

6666

67-
@pytest.fixture
67+
@pytest_asyncio.fixture
6868
def topic(async_client):
6969
return async_client.feed("topic", f"1-{uuid4()}")
7070

7171

72-
@pytest.fixture
72+
@pytest_asyncio.fixture
7373
def flat3(async_client):
7474
return async_client.feed("flat", f"3-{uuid4()}")

stream/tests/test_client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,6 @@ def test_activity_partial_update(self):
12941294
self.assertEqual(updated, expected)
12951295

12961296
def test_activities_partial_update(self):
1297-
12981297
feed = self.c.feed("user", uuid4())
12991298
feed.add_activities(
13001299
[

stream/users/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def delete(self, user_id):
2424

2525

2626
class BaseUsers(AbstractUsers, ABC):
27-
2827
API_ENDPOINT = "user/"
2928
SERVICE_NAME = "api"
3029

0 commit comments

Comments
 (0)