Skip to content

Fix pretty asserts in utilities files#1459

Merged
smola merged 4 commits intomainfrom
smola/pretty-asserts
Aug 8, 2023
Merged

Fix pretty asserts in utilities files#1459
smola merged 4 commits intomainfrom
smola/pretty-asserts

Conversation

@smola
Copy link
Copy Markdown
Member

@smola smola commented Aug 4, 2023

Description

Pytests transforms tests to convert calls to assert to richer pretty asserts. However, it does so only in files scanner for tests. That is, those matched by the test_*.py pattern.

This change adds _test_*.py to the list of valid test file patterns, and moves existing test utilities to use that convention and benefit from pretty asserts.

Pretty assertions include the values of variables used in assertions, diffs, etc.

Motivation

Workflow

  1. ⚠️⚠️ Create your PR as draft
  2. Follow the style guidelines of this project (See how to easily lint the code)
  3. Work on you PR until the CI passes (if something not related to your task is failing, you can ignore it)
  4. Mark it as ready for review

Once your PR is reviewed, you can merge it! ❤️

Reviewer checklist

  • Check what scenarios are modified. If needed, add the relevant label (run-parametric-scenario, run-profiling-scenario...). If this PR modifies any system-tests internal, then add the run-all-scenarios label (more info).
  • CI is green
    • If not, failing jobs are not related to this change (and you are 100% sure about this statement)
  • if any of build-some-image label is present
    1. is the image labl have been updated ?
    2. just before merging, locally build and push the image to hub.docker.com

Pytests transforms tests to convert calls to `assert` to richer pretty
asserts. However, it does so only in files scanner for tests. That is,
those matched by the `test_*.py` pattern.

This change adds `_test_*.py` to the list of valid test file patterns,
and moves existing test utilities to use that convention and benefit
from pretty asserts.

Pretty assertions include the values of variables used in assertions,
diffs, etc.
@smola smola marked this pull request as ready for review August 7, 2023 07:01
@smola smola requested review from a team as code owners August 7, 2023 07:01
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.

2 participants