Skip to content

Use two TestClient fixtures, raising or not exceptions in tests - #1058

Open
armanddidierjean wants to merge 1 commit into
mainfrom
raise-in-tests
Open

Use two TestClient fixtures, raising or not exceptions in tests#1058
armanddidierjean wants to merge 1 commit into
mainfrom
raise-in-tests

Conversation

@armanddidierjean

Copy link
Copy Markdown
Member

Description

Summary

Use two TestClient fixtures, raising or not exceptions in tests instead of never raising exceptions.
We may want to not raise exception and instead return a proper 500 response to assert that an InternalServerError happens in specific situations But raising exception should be the usual default, as InternalServerError should rarely be expected to happen. Raising the exception allows it to be logged by pytest and make debugging easier

Classification

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 🔨 Refactor (non-breaking change that neither fixes a bug nor adds a feature)
  • 🔧 Infra CI/CD (changes to configs of workflows)
  • 💥 BREAKING CHANGE (fix or feature that require a new minimal version of the front-end)
  • 😶‍🌫️ No impact for the end-users

Impact & Scope

  • Core functionality changes
  • Single module changes
  • Multiple modules changes
  • Database migrations required
  • Other: ...

Testing

  • 1. Tested this locally
  • 2. Added/modified tests that pass the CI (or tested in a downstream fork)
  • 3. Tested in a deployed pre-prod
  • 0. Untestable (exceptionally), will be tested in prod directly

Documentation

  • Updated the docs accordingly :
  • " Docstrings
  • # Inline comments
  • No documentation needed

instead of never raising exceptions.
We may want to not raise exception and instead return a proper 500 response to assert that an InternalServerError happens in specific situations
But raising exception should be the usual default, as InternalServerError should rarely be expected to happen. Raising the exception allows it to be logged by pytest and make debugging easier
@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.99%. Comparing base (e9b5f53) to head (6ca7f23).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1058   +/-   ##
=======================================
  Coverage   84.99%   84.99%           
=======================================
  Files         220      220           
  Lines       16273    16273           
=======================================
  Hits        13831    13831           
  Misses       2442     2442           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant