Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing test #8

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Run pytest tests

on:
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
- name: Pytest summary
uses: dariocurr/pytest-summary@v2
with:
paths: my_code.py

11 changes: 11 additions & 0 deletions my_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,14 @@ def fix_phone_num(phone_num_to_fix):

def test_fix_phone_num():
assert fix_phone_num("5125558823") == '(512) 555 8823'
assert fix_phone_num("5554429876") == '(555) 442 9876'
assert fix_phone_num("3216543333") == '(321) 654 3333'

def fix_dash_paranthesis():
assert fix_phone_num("555-442-98761") = '(555) 442 9876'
assert fix_phone_num("(321) 654 3333") = '(321) 654 3333'
assert 9 < 3
assert 4 > 8
assert True == False