diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..320e6df --- /dev/null +++ b/.github/workflows/main.yml @@ -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 + diff --git a/my_code.py b/my_code.py index dbdeadf..251af5b 100644 --- a/my_code.py +++ b/my_code.py @@ -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 + +