AlgebraicJulia / AlgebraicJulia/Decapodes.jl

@testset Scope

Offen
#174 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
code-quality enhancement
Vorherrschende Sprache
Julia
Sterne
91
Forks
18
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

During last week's hackathon, a non-negligible amount of developer time was spent tracking down the following error:
- A `@test` was written which assigned a local variable the name `d`
- A later test loaded CombinatorialSpaces with `using CombinatorialSpaces`
- CombinatorialSpaces exports a function for the exterior derivative `d`
- Later code trying to allocate an exterior derivative matrix threw an unhelpful error message
- Moving the order of the `@testsets` meant that a helpful error message was thrown at the line where the local variable `d` was declared

Errors in our test suite should not depend on the order in which testsets are included. Each testset should be contained.

So, we should look into how to prevent this behavior. I immediately want to use `let ... end` blocks, but it appears that there is some advice on testset scoping that I haven't fully grasped: https://discourse.julialang.org/t/testset-scoping/17025
Perhaps we have poor `module` management in the test suite.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.