# Test utilities in a Revise-friendly module

**URL:** <https://discourse.julialang.org/t/test-utilities-in-a-revise-friendly-module/138967>\
**Category:** General Usage\
**Tags:** question, module\
**Created:** [August 21, 2026, 7:23am UTC](https://discourse.julialang.org/t/test-utilities-in-a-revise-friendly-module/138967 "2026-08-21T07:23:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [August 21, 2026, 7:23am UTC](https://discourse.julialang.org/t/test-utilities-in-a-revise-friendly-module/138967/1 "2026-08-21T07:23:33Z")

</div>

For complicated packages, I use reasonably complex test utilities, on the level of 500-1k LoC.

I would like to move them into their own module _that I can track with Revise.jl_. Eg in `runtests.jl`, I want to have

```julia
using MyWonderfulPackage, Test, MyTestUtils

```

and in some file have

```julia
module MyTestUtils

export various, functions

end

```

The point would be that I can tweak the latter file and Revise would pick up the changes without me re-evaluating the code explictily. (_For the purposes of this discussion, assume that I don’t want to use `Revise.includet`_).

How can I do this? I tried various locations for `MyTestUtils.jl` but `using` is not finding it. I tried `test/MyTestUtils.jl`, `test/MyTestUtils/src/MyTestUtils.jl`, `dev`ing the latter, etc.

---

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [August 21, 2026, 7:45am UTC](https://discourse.julialang.org/t/test-utilities-in-a-revise-friendly-module/138967/2 "2026-08-21T07:45:04Z")

</div>

A while back I wrote a small test suite for one of my packages and since adapted it to one other packages as well.

I personally ended up with a submodule, i.e. `MyPackage.Test` – which is maybe not the best of names when you export that to global namespace, then maybe in hindsight `MyPackage.MyPackageTestSuite` or so would be better.  
In my scenario I have to test a functionality on several objects.

The example is [Manifolds.jl/src/test-suite.jl at master · JuliaManifolds/Manifolds.jl · GitHub](https://github.com/JuliaManifolds/Manifolds.jl/blob/master/src/test-suite.jl)

It is also “filled” with certain functions in a weak dependency to `Test` see

> <https://github.com/JuliaManifolds/Manifolds.jl/blob/master/ext/ManifoldsTestExt/ManifoldsTestExt.jl>

so that in a real scenario it looks something like

> <https://github.com/JuliaManifolds/Manifolds.jl/blob/5cbafe0c5a00f63563142b54f89ce9bb1dd2f7af/test/manifolds/test_sphere.jl#L22>

Might not be 100% what you are looking for – not sure – but the submodule Idea (and weak dependency) works very well in this scenario at least.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [August 21, 2026, 7:47am UTC](https://discourse.julialang.org/t/test-utilities-in-a-revise-friendly-module/138967/3 "2026-08-21T07:47:35Z")

</div>

Thanks! That could work, but it would require adding a new function in _two_ places (the second to be loaded conditionally), it is a but more convoluted than what I am looking for.

Update on my original question: I had a corrupted `test/MyTestUtils/Project.toml` (probably overenthusiastic use of `dev` at some point), regenerating that makes the whole thing work. That is, I now have a

```julia
├── Project.toml
├── src
│ └── Foo.jl
└── test
    ├── Project.toml
    ├── runtests.jl
    └── TestUtils
        ├── Project.toml
        └── src
            └── TestUtils.jl

```

which works if I `dev ./TestUtils` from `test`.

I wonder if it would be possible to flatten the directory hierarchy a bit though.

---

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [August 21, 2026, 7:53am UTC](https://discourse.julialang.org/t/test-utilities-in-a-revise-friendly-module/138967/4 "2026-08-21T07:53:53Z")

</div>

Yes, the `src/test/test_suite.jl` file basically only contains “Headers and Doc strings”, the implementation – since it requires `Test`y things is in the extension.  
I do see, that that is a disadvantage.

I actually started with a module in the test folder as well – though without the “Package-y things” around (so just a `TestUtils.jl` with a module inside) – and either imported or `dev`ed that as well earlier.

The reason for my solution of a submodule came from the point that I would like to also let others use these test tools if they wanted to, and as a submodule it “ships” with the package in a “direct way”. But for sure there might be other use cases you have in mind as well.

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [August 21, 2026, 7:52pm UTC](https://discourse.julialang.org/t/test-utilities-in-a-revise-friendly-module/138967/5 "2026-08-21T19:52:37Z")

</div>

In the test item framework this scenario is handled by [`@testmodule` blocks](https://julia-testitems.org/guide/writing-tests#test-modules-testmodule), they cover essentially exactly this scenario, and everything in that framework is using Revise and other techniques to auto-process changes. But of course it entails adopting a different test framework..
