Skip to content

Commit 9627c5d

Browse files
committed
feat: fix
1 parent 2652f78 commit 9627c5d

File tree

5 files changed

+38
-6
lines changed

5 files changed

+38
-6
lines changed

.pre-commit-config.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Pre-commit hooks configuration
2+
# Install: uv run pre-commit install
3+
# Run manually: uv run pre-commit run --all-files
4+
5+
repos:
6+
# Ruff - linting and formatting (same as CI)
7+
- repo: https://github.com/astral-sh/ruff-pre-commit
8+
rev: v0.8.6
9+
hooks:
10+
# Linting: ruff check src/ tests/
11+
- id: ruff
12+
args: [--fix]
13+
types_or: [python, pyi]
14+
# Formatting: ruff format src/ tests/
15+
- id: ruff-format
16+
types_or: [python, pyi]
17+
18+
# Type checking with mypy (same as CI: mypy src/)
19+
- repo: local
20+
hooks:
21+
- id: mypy
22+
name: mypy
23+
entry: uv run mypy src/
24+
language: system
25+
types: [python]
26+
pass_filenames: false

tests/e2e/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ class E2ETestData:
4848

4949
# Tweet test data - use recent tweets from stable accounts
5050
# These may need periodic updates if tweets are deleted
51-
tweet_id: str = os.environ.get("TEST_TWEET_ID", "1802331592918618529")
51+
tweet_id: str = "1802331592918618529"
5252

5353
# List test data - use public lists
54-
list_id: str = os.environ.get("TEST_LIST_ID", "1736495155853967360")
54+
list_id: str = "1736495155853967360"
5555

5656
# Community test data
57-
community_id: str = os.environ.get("TEST_COMMUNITY_ID", "1493016274714259462")
57+
community_id: str = "1493016274714259462"
5858

5959
# Geo test data
6060
place_id: str = "5a110d312052166f" # San Francisco

tests/e2e/test_lists.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
class TestGetDetail:
1717
"""Tests for get_detail method."""
1818

19-
async def test_get_detail_returns_list(self, client: ScrapeBadger, test_data: E2ETestData) -> None:
19+
async def test_get_detail_returns_list(
20+
self, client: ScrapeBadger, test_data: E2ETestData
21+
) -> None:
2022
"""Test fetching list details returns valid list data."""
2123
lst = await client.twitter.lists.get_detail(test_data.list_id)
2224

tests/e2e/test_tweets.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
class TestGetById:
1515
"""Tests for get_by_id method."""
1616

17-
async def test_get_by_id_returns_tweet(self, client: ScrapeBadger, test_data: E2ETestData) -> None:
17+
async def test_get_by_id_returns_tweet(
18+
self, client: ScrapeBadger, test_data: E2ETestData
19+
) -> None:
1820
"""Test fetching a tweet by ID returns valid tweet data."""
1921
tweet = await client.twitter.tweets.get_by_id(test_data.tweet_id)
2022

tests/e2e/test_users.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ async def test_get_by_username_includes_counts(
3939
class TestGetById:
4040
"""Tests for get_by_id method."""
4141

42-
async def test_get_by_id_returns_user(self, client: ScrapeBadger, test_data: E2ETestData) -> None:
42+
async def test_get_by_id_returns_user(
43+
self, client: ScrapeBadger, test_data: E2ETestData
44+
) -> None:
4345
"""Test fetching a user by ID returns valid user data."""
4446
user = await client.twitter.users.get_by_id(test_data.user_id)
4547

0 commit comments

Comments
 (0)