Skip to content

fix: resolve missing pytest fixture in test_health_check#274

Closed
anshul23102 wants to merge 2 commits into
komalharshita:mainfrom
anshul23102:fix/test-health-check-fixture
Closed

fix: resolve missing pytest fixture in test_health_check#274
anshul23102 wants to merge 2 commits into
komalharshita:mainfrom
anshul23102:fix/test-health-check-fixture

Conversation

@anshul23102
Copy link
Copy Markdown

@anshul23102 anshul23102 commented May 18, 2026

Closes #273

What was wrong

test_health_check(client) declared client as a parameter, expecting a pytest fixture that was never defined anywhere in the test file. Every other test uses the local get_client() helper directly. This caused pytest to report an ERROR on every run, meaning the /health endpoint was never actually tested.

What changed

Removed the client parameter and added client = get_client() inside the function body, consistent with all other tests in the file.

Tests

pytest tests/ -v
# 30 passed  (was: 29 passed, 1 error)

Type of change

  • Bug fix (test infrastructure)

_projects_cache was declared but load_all_projects() never read or
wrote it, causing a redundant disk read on every request. Added
double-checked locking with threading.Lock so the JSON file is
read once and reused safely across concurrent requests.
clear_cache() now acquires the same lock before resetting.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 18, 2026

@anshul23102 is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel.

A member of the Team first needs to authorize it.

test_health_check(client) declared a 'client' parameter expecting
a pytest fixture that was never defined. Every other test in the
suite uses the local get_client() helper instead. The error caused
the entire test run to report an ERROR and the health endpoint was
never actually tested.
@anshul23102 anshul23102 force-pushed the fix/test-health-check-fixture branch from d832302 to dd96f52 Compare May 18, 2026 07:44
@github-actions github-actions Bot added gssoc-2026 type:bug Something isn't working labels May 18, 2026
@anshul23102
Copy link
Copy Markdown
Author

Closing in favour of a cleaner PR with only the relevant commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: test_health_check fails with missing pytest fixture error

1 participant