Skip to content

Update unittests#67

Merged
bmwant merged 6 commits intomainfrom
update-unittests
Oct 2, 2025
Merged

Update unittests#67
bmwant merged 6 commits intomainfrom
update-unittests

Conversation

@bmwant
Copy link
Owner

@bmwant bmwant commented Oct 2, 2025

Description

  • Fix type checks for tests directory

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes type checking issues in the tests directory by adding type annotations and updating configuration to enable type checking for test files.

  • Adds type annotations to CLI functions and test utilities
  • Includes type ignore comments for dynamic attribute assignments
  • Removes exclusion of tests directory from type checking configuration

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_hap_workdir.py Adds null check assertion for type safety
tests/test_cli_utils.py New test file for CLI utilities with proper typing
tests/conftest.py Adds type ignore comment for dynamic attribute assignment
pyproject.toml Removes tests directory from type checking exclusion and reorders dependencies
hapless/utils.py Adds new utility functions with proper imports
hapless/main.py Updates imports and uses new utility function
hapless/cli.py Adds type annotations to function parameters
README.md Updates badges to replace black formatter badge with ty type checker
DEVELOP.md Adds documentation for linting and type checking commands
.github/workflows/tests.yml Removes conditional type checking for tests directory

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

hapless_test = Hapless(hapless_dir=Path(path))
with patch("hapless.cli.hapless", hapless_test) as hapless_mock:
cli_runner.hapless = hapless_mock
cli_runner.hapless = hapless_mock # ty: ignore[unresolved-attribute]
Copy link

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type ignore comment contains a typo. It should be type: ignore instead of ty: ignore.

Suggested change
cli_runner.hapless = hapless_mock # ty: ignore[unresolved-attribute]
cli_runner.hapless = hapless_mock # type: ignore[unresolved-attribute]

Copilot uses AI. Check for mistakes.
@bmwant bmwant merged commit 2a91cb8 into main Oct 2, 2025
9 checks passed
@bmwant bmwant deleted the update-unittests branch October 2, 2025 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants