Skip to content

[Bug]: test_redis_url fails when local .env file contains REDIS_URL #161

Description

@Deepthit-23

Affected Component

Schemas / Libs (libs/)

Bug Description

The unit test test_redis_url in tests/test_settings.py instantiates the Settings class without overriding environment variables. If a local .env file exists in the repository root containing custom variables (such as a modified REDIS_URL), Pydantic reads it, causing default setting verification tests to fail.

Steps to Reproduce

  1. Add REDIS_URL=redis://localhost:6379/0 to your local .env file.
  2. Run settings tests:
    python -m pytest tests/test_settings.py -k TestDefaults -v
    
    

Expected Behavior

The settings unit tests should isolate default values testing so that local config files (.env) do not override the expected default assertions.

Actual Behavior

When a local .env file exists with customized settings (such as REDIS_URL=redis://localhost:6379/0), test_redis_url fails:
AssertionError: assert 'redis://localhost:6379/0' == 'redis://localhost:6379'

Python Version

3.11

Operating System

Windows 11

Inference Device

None

Error Log / Traceback

Screenshots or Recordings

No response

Additional Context

No response

Checklist

  • I have searched existing issues and this is not a duplicate.
  • I have tested with the latest version of the main branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions