Skip to content

Commit

Permalink
Adds script and test_script, sets .yml testing location to tests/
Browse files Browse the repository at this point in the history
  • Loading branch information
admeeer committed Oct 10, 2023
1 parent bd8aa4b commit 248a9c4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
- name: test
run: |
pytest
pytest tests/
2 changes: 2 additions & 0 deletions script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# script.py
print("Hello, World!")
11 changes: 11 additions & 0 deletions tests/test_script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# test_script.py
import subprocess

def test_hello_world_output(capfd):
subprocess.run(['python', './script.py'])

# Capture the output
captured = capfd.readouterr()

# Assert the output is correct
assert captured.out == "Hello, World!\n"

0 comments on commit 248a9c4

Please sign in to comment.