Skip to content

Commit

Permalink
update pytest output
Browse files Browse the repository at this point in the history
  • Loading branch information
minimike86 committed Oct 25, 2024
1 parent 4c33e50 commit 4b25bcc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,27 @@ jobs:
- name: Run tests
run: |
poetry run pytest | tee pytest_output.txt
poetry run pytest --tb=short | tee pytest_output.txt
- name: Display test results in summary
if: always()
run: |
echo "### Test Results" >> $GITHUB_STEP_SUMMARY
echo "### 🎉 Test Summary Report 🎉" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Status | Test |" >> $GITHUB_STEP_SUMMARY
echo "| ------ | ---- |" >> $GITHUB_STEP_SUMMARY
# Iterate through pytest output to generate a summary
while IFS= read -r line; do
if [[ $line == *"PASSED"* ]]; then
echo "| ✅ | $line |" >> $GITHUB_STEP_SUMMARY
elif [[ $line == *"FAILED"* ]]; then
echo "| ❌ | $line |" >> $GITHUB_STEP_SUMMARY
fi
done < pytest_output.txt
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 📜 Detailed Output 📜" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
cat pytest_output.txt >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
4 changes: 2 additions & 2 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import pytest

from twitchrce.main import get_app_token


@pytest.mark.asyncio
@pytest.mark.filterwarnings("ignore::DeprecationWarning")
async def test_get_app_token():
from twitchrce.main import get_app_token

# Mock the response from client_credentials_grant_flow
mock_response = {
"access_token": "1234567890abcdef1234567890abcdef",
Expand Down

0 comments on commit 4b25bcc

Please sign in to comment.