Test import error: ValidationError not defined in validator module #7

Closed
opened 2026-03-05 21:32:25 +00:00 by Mark · 1 comment
Owner

Description

The test file tests/unit/test_animbuild.py imports ValidationError from animbuild.utils.validator:

from animbuild.utils.validator import ValidationError

However, ValidationError class does not exist in animbuild/utils/validator.py. The validator module collects validation errors in a list parameter rather than raising exceptions.

This causes test collection to fail:

ImportError: cannot import name 'ValidationError' from 'animbuild.utils.validator'

Expected Behavior

Either:

  1. Add a ValidationError exception class to animbuild/utils/validator.py, OR
  2. Update the tests to work with the current design (errors collected in a list)

Test Command

python -m pytest tests/ -v
## Description The test file `tests/unit/test_animbuild.py` imports `ValidationError` from `animbuild.utils.validator`: ```python from animbuild.utils.validator import ValidationError ``` However, `ValidationError` class does not exist in `animbuild/utils/validator.py`. The validator module collects validation errors in a list parameter rather than raising exceptions. This causes test collection to fail: ``` ImportError: cannot import name 'ValidationError' from 'animbuild.utils.validator' ``` ## Expected Behavior Either: 1. Add a `ValidationError` exception class to `animbuild/utils/validator.py`, OR 2. Update the tests to work with the current design (errors collected in a list) ## Test Command ```bash python -m pytest tests/ -v ```
Author
Owner

Issue Resolution

After investigation, this issue is already resolved in the current codebase.

Findings:

  • ValidationError class exists at animbuild/utils/validator.py lines 31-33:
    class ValidationError(Exception):
        """Raised when validation fails."""
        pass
    
  • All 18 tests in tests/unit/test_animbuild.py pass successfully
  • The import from animbuild.utils.validator import ValidationError works correctly

Test Results:

============================= test session starts ==============================
platform linux -- Python 3.12.3, pytest-8.4.2
...
collected 18 items
tests/unit/test_animbuild.py .......................................... [100%]

============================== 18 passed in 0.23s ==============================

Closing as resolved.

## Issue Resolution After investigation, this issue is **already resolved** in the current codebase. **Findings:** - `ValidationError` class exists at `animbuild/utils/validator.py` lines 31-33: ```python class ValidationError(Exception): """Raised when validation fails.""" pass ``` - All 18 tests in `tests/unit/test_animbuild.py` pass successfully - The import `from animbuild.utils.validator import ValidationError` works correctly **Test Results:** ``` ============================= test session starts ============================== platform linux -- Python 3.12.3, pytest-8.4.2 ... collected 18 items tests/unit/test_animbuild.py .......................................... [100%] ============================== 18 passed in 0.23s ============================== ``` Closing as resolved.
Mark closed this issue 2026-03-10 03:56:05 +00:00
Sign in to join this conversation.
No description provided.