feat: Add test scripts and runner for TheChart application
- Created demo_failing_test.py to demonstrate pre-commit blocking with a failing test. - Added run_tests.py for executing all tests with coverage reporting. - Introduced test.py as a quick test runner for the application, providing coverage reports and user-friendly output.
This commit is contained in:
19
scripts/demo_failing_test.py
Normal file
19
scripts/demo_failing_test.py
Normal file
@@ -0,0 +1,19 @@
|
||||
"""
|
||||
Demonstration script to show pre-commit test blocking.
|
||||
This creates a temporary failing test to demonstrate the pre-commit behavior.
|
||||
"""
|
||||
|
||||
# Create a simple test file that will fail
|
||||
test_content = '''
|
||||
def test_that_will_fail():
|
||||
"""This test is designed to fail to demonstrate pre-commit blocking."""
|
||||
assert False, "This test intentionally fails"
|
||||
'''
|
||||
|
||||
with open("tests/test_demo_fail.py", "w") as f:
|
||||
f.write(test_content)
|
||||
|
||||
print("Created temporary failing test: tests/test_demo_fail.py")
|
||||
print("Now try: git add . && git commit -m 'test commit'")
|
||||
print("The commit should be blocked by the failing test.")
|
||||
print("Remove the file with: rm tests/test_demo_fail.py")
|
||||
Reference in New Issue
Block a user