Skip to content
Merged
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
8 changes: 7 additions & 1 deletion .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,26 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.11']
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: ${{ matrix.python-version }}

- name: Syntax check
run: python3 -m py_compile install-skills.py

- name: Help runs
run: python3 install-skills.py --help

- name: Regression tests
run: python3 -m unittest -v test_install_skills.py

- name: Smoke test against a fake checkout
run: |
set -eu
Expand Down
Binary file removed __pycache__/install-skills.cpython-314.pyc
Binary file not shown.
2 changes: 2 additions & 0 deletions install-skills.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
environment variable, or walking up from the current directory.
"""

from __future__ import annotations

import argparse
import os
import sys
Expand Down
26 changes: 26 additions & 0 deletions test_install_skills.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python3
"""Regression tests for install-skills.py."""

import subprocess
import sys
import unittest
from pathlib import Path


SCRIPT = Path(__file__).with_name('install-skills.py')


class InstallSkillsCliTest(unittest.TestCase):
def test_help_runs_on_supported_python(self):
result = subprocess.run(
[sys.executable, str(SCRIPT), '--help'],
capture_output=True,
text=True,
)

self.assertEqual(result.returncode, 0, result.stderr)
self.assertIn('usage:', result.stdout)


if __name__ == '__main__':
unittest.main()
Loading