Skip to content

[int] Remove asserts from non-test code#8564

Merged
fstagni merged 1 commit into
DIRACGrid:integrationfrom
sfayer:check_assert
Jun 4, 2026
Merged

[int] Remove asserts from non-test code#8564
fstagni merged 1 commit into
DIRACGrid:integrationfrom
sfayer:check_assert

Conversation

@sfayer
Copy link
Copy Markdown
Member

@sfayer sfayer commented Jun 2, 2026

Hi,

Part of #8547. This removes all assert usage in non-test code paths as this can misbehave in certain circumstances (as I understand it certain types of packaging that pre-build the byte code can remove asserts as an optimisation). In most cases I've switched it to an AssertionError which will give exactly the same behaviour but won't get optimised out.

Regards,
Simon

BEGINRELEASENOTES
*All
FIX: Remove asserts from non-test code.
ENDRELEASENOTES

Comment thread src/DIRAC/Core/LCG/GOCDBClient.py Outdated
Comment thread src/DIRAC/Core/Utilities/Graphs/PieGraph.py Outdated
Co-authored-by: Federico Stagni <federico.stagni@cern.ch>
@sfayer sfayer marked this pull request as ready for review June 4, 2026 08:19
@sfayer sfayer requested a review from atsareg as a code owner June 4, 2026 08:19
@fstagni fstagni merged commit 3cc2767 into DIRACGrid:integration Jun 4, 2026
32 of 33 checks passed
@DIRACGridBot DIRACGridBot added the sweep:ignore Prevent sweeping from being ran for this PR label Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sweep:ignore Prevent sweeping from being ran for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants