Skip to content

Commit

Permalink
Add pytest action
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisOwen101 committed Oct 10, 2024
1 parent 52b1d50 commit 216a633
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Code
name: Run Tests
on:
workflow_dispatch:
pull_request:
Expand All @@ -7,11 +7,12 @@ on:
- main
jobs:
run_code:
name: Runs my code
name: Run my tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: python longest.py
- run: pip install pytest
- run: pytest test_longest.py
5 changes: 5 additions & 0 deletions test_longest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from longest import find_longest


def test_get_longest():
assert "yellow" == find_longest(["yellow", "red", "blue", "green"])

0 comments on commit 216a633

Please sign in to comment.