Skip to content

Commit ffe3086

Browse files
DevOpsDerekCopilot
andcommitted
fix: Python 3.9 compatibility and pytest config
- Add 'from __future__ import annotations' to 3 files using X | None union syntax (PEP 604 requires Python 3.10+; deferred evaluation makes it safe on 3.9) - Replace unsupported collect_ignore_glob with norecursedirs in [tool.pytest.ini_options] (collect_ignore_glob is not a valid pyproject.toml pytest key, causing PytestConfigWarning) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e6ab108 commit ffe3086

4 files changed

Lines changed: 10 additions & 4 deletions

File tree

‎03_process_management/kill_process.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
- Safety patterns: dry-run mode, confirmation, protected list
1010
"""
1111

12+
from __future__ import annotations
13+
1214
import time
1315

1416
import psutil # pip install psutil

‎exercises/03_disk_alert/solution.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Exercise 03 — Disk Space Alert ✅ SOLUTION
33
"""
44

5+
from __future__ import annotations
6+
57
import sys
68

79
import psutil

‎exercises/10_health_snapshot/solution.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Exercise 10 — System Health Snapshot ✅ SOLUTION
33
"""
44

5+
from __future__ import annotations
6+
57
import json
68
import socket
79
from datetime import datetime

‎pyproject.toml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ exclude = [
4949
known-third-party = ["psutil", "schedule"]
5050

5151
[tool.pytest.ini_options]
52-
testpaths = ["tests"]
53-
addopts = "-v --tb=short"
54-
# Ignore exercise starter files — they contain intentional incomplete code
55-
collect_ignore_glob = ["exercises/*/exercise.py"]
52+
testpaths = ["tests"]
53+
addopts = "-v --tb=short"
54+
# Exercise starter files contain intentional incomplete code — don't collect them
55+
norecursedirs = ["exercises"]

0 commit comments

Comments
 (0)