Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
admeeer committed Oct 10, 2023
1 parent 277b046 commit 5061afe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
name: cicd

# only run this workflow when something is pushed to main
on:
push:
branches:
- main

# define our jobs
jobs:
build:

build_and_test:
# define our OS
runs-on: ubuntu-latest

# rely on predefined GitHub actions to setup our python environment
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.8
# setup step
- name: setup
uses: actions/setup-python@v2
with:
python-version: 3.8

python-version: 3.9
# install step
- name: install
run: |
python -m pip install --upgrade pip
pip install pytest
# test step
- name: test
run: |
pytest tests/
3 changes: 2 additions & 1 deletion tests/test_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
import subprocess

def test_script_output(capfd):
# run the script file under a new process
subprocess.run(['python', './script.py'])

# Capture the output
# Capture process output
captured = capfd.readouterr()

# Assert the output is correct
Expand Down

0 comments on commit 5061afe

Please sign in to comment.