# \#testjl-unittesting

**URL:** https://discourse.julialang.org/tag/testjl-unittesting/502.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Test.jl seems to have problems catching ArgParse.jl's exceptions](https://discourse.julialang.org/t/test-jl-seems-to-have-problems-catching-argparse-jls-exceptions/131795)

<div class="topic-metadata">

**Author:** [@pkalaczynski](https://discourse.julialang.org/u/pkalaczynski)\
**Replies:** 6\
**Last updated:** [September 4, 2025, 3:35pm UTC](https://discourse.julialang.org/t/test-jl-seems-to-have-problems-catching-argparse-jls-exceptions/131795 "2025-09-04T15:35:36Z")

</div>

Hi, I’ve been implementing unit tests for my project, and generally I’m very happy with Test.jl, however I stumbled across a weird problem when trying to do tests for argument parsing. I handle it using ArgParse.jl and …

---

## [Unit test for constant folding success](https://discourse.julialang.org/t/unit-test-for-constant-folding-success/124625)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 6\
**Last updated:** [January 10, 2025, 11:02am UTC](https://discourse.julialang.org/t/unit-test-for-constant-folding-success/124625 "2025-01-10T11:02:52Z")

</div>

Here’s a proposal for how to test for successful constant folding: using Test function test\_constant\_folding(f, r) vec = code\_typed(f, Tuple{}) p = only(vec) code\_info = first(p) code = try code…

---

## [Unit testing with generated code](https://discourse.julialang.org/t/unit-testing-with-generated-code/110614)

<div class="topic-metadata">

**Author:** [@mike.ingold](https://discourse.julialang.org/u/mike.ingold)\
**Replies:** 8\
**Last updated:** [February 23, 2024, 1:02pm UTC](https://discourse.julialang.org/t/unit-testing-with-generated-code/110614 "2024-02-23T13:02:04Z")

</div>

Problem Statement: I have a package where a number of functions are defined with multiple-dispatch signatures like f(x::A, y::B). Say that methods may be implemented for m types A and n types B and there are p functions,…

---

## [Missing reference warning for unit Test module in VS code?](https://discourse.julialang.org/t/missing-reference-warning-for-unit-test-module-in-vs-code/69996)

<div class="topic-metadata">

**Author:** [@joseph\_s](https://discourse.julialang.org/u/joseph_s)\
**Replies:** 0\
**Last updated:** [October 18, 2021, 6:19pm UTC](https://discourse.julialang.org/t/missing-reference-warning-for-unit-test-module-in-vs-code/69996 "2021-10-18T18:19:44Z")

</div>

VS Code Julia extension gives Missing reference warning for following using Test @test true I’m using Julia extension v1.4.3. How to get rid of this?

---

## [SetUp and TearDown in Test module?](https://discourse.julialang.org/t/setup-and-teardown-in-test-module/68589)

<div class="topic-metadata">

**Author:** [@fspreck-indiscale](https://discourse.julialang.org/u/fspreck-indiscale)\
**Replies:** 4\
**Last updated:** [September 23, 2021, 7:34am UTC](https://discourse.julialang.org/t/setup-and-teardown-in-test-module/68589 "2021-09-23T07:34:26Z")

</div>

Hello everyone, I’m still quite new to Julia, so please excuse me if I have missed something obvious here. Is there a way in Test.jl to declare functions that are called before/after every @testset similar to SetUp/Tea…

---

## [How to test a function in Julia](https://discourse.julialang.org/t/how-to-test-a-function-in-julia/58196)

<div class="topic-metadata">

**Author:** [@oo92](https://discourse.julialang.org/u/oo92)\
**Replies:** 6\
**Last updated:** [March 30, 2021, 12:29am UTC](https://discourse.julialang.org/t/how-to-test-a-function-in-julia/58196 "2021-03-30T00:29:27Z")

</div>

Hi. I have familiarity with unit testing in Python but I couldn’t really figure out how to do it in Julia when it comes to functions. function year\_created(p, language::String) loc = findfirst(p\[:,2\] .== language) re…

---

## [Using test.jl to prove trig identies](https://discourse.julialang.org/t/using-test-jl-to-prove-trig-identies/48654)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 9\
**Last updated:** [October 19, 2020, 11:46pm UTC](https://discourse.julialang.org/t/using-test-jl-to-prove-trig-identies/48654 "2020-10-19T23:46:14Z")

</div>

I’m trying to do a proof using trig identities, I get a fail, and I,m not sure if I’m using @test wrong, or if I made a mistake in my math s.t. cos(x)-cos(y)=-2\*(sin((x+y)/2)\*sin((x-y)/2)) using Plots using test FX=f…
