# Usability improvements in TestItemRunner.@testmodule

**URL:** https://discourse.julialang.org/t/usability-improvements-in-testitemrunner-testmodule/132513
**Category:** General Usage
**Tags:** testing, module
**Created:** [September 19, 2025, 2:42pm UTC](https://discourse.julialang.org/t/usability-improvements-in-testitemrunner-testmodule/132513 "2025-09-19T14:42:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ken\_Williams](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ken_williams/32/5289_2.png) [@Ken\_Williams](https://discourse.julialang.org/u/Ken_Williams)
#### Post date: [September 19, 2025, 2:42pm UTC](https://discourse.julialang.org/t/usability-improvements-in-testitemrunner-testmodule/132513/1 "2025-09-19T14:42:25Z")

</div>

There are a couple of usability improvements I’d love to see in the `@testmodule` functionality from `TestItemRunner`:

1. The ability to load a testing module from the REPL, so I could do something like

```julia-auto
TestEnv.activate()
load_test_module("Foo") # finds '@testmodule Foo' definition and loads it
...now run interactive code that uses the testing modules

```

The workaround I’m doing for #1 right now is to find the code & paste it into the REPL - not great, and it’s not always straightforwardly pasteable.

1. Export names from a test module:

```julia-auto
@testmodule Bar begin
    do_stuff(a, b) = a * b
    export do_stuff
end

```

The workaround for #2 is to do stuff like this in my unit tests:

```julia-auto
@testitem "My Test" setup = [Bar] begin
    do_stuff = Bar.do_stuff
    ...
end

```

I’ve thought about taking a crack at these myself, probably with a heavy assist from Claude or Copilot or something, but wanted to get anyone else’s opinions on feasibility, or approach, or thoughts about different objectives, etc. before starting that myself. I would also be happy to see anyone else accomplish them who knows what they’re doing in this code better than I do. =)

---

<div class="post-metadata">

### Author: ![Ken\_Williams](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ken_williams/32/5289_2.png) [@Ken\_Williams](https://discourse.julialang.org/u/Ken_Williams)
#### Post date: [September 19, 2025, 5:48pm UTC](https://discourse.julialang.org/t/usability-improvements-in-testitemrunner-testmodule/132513/2 "2025-09-19T17:48:09Z")

</div>

I remembered that I opened a ticket about #2 a while ago too: [Can't export items from @testmodule modules · Issue #98 · julia-vscode/TestItemRunner.jl · GitHub](https://github.com/julia-vscode/TestItemRunner.jl/issues/98)

---

<div class="post-metadata">

### Author: ![Ken\_Williams](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ken_williams/32/5289_2.png) [@Ken\_Williams](https://discourse.julialang.org/u/Ken_Williams)
#### Post date: [October 9, 2025, 9:53pm UTC](https://discourse.julialang.org/t/usability-improvements-in-testitemrunner-testmodule/132513/3 "2025-10-09T21:53:29Z")

</div>

In some spare time, I did make a proof-of-concept for loading Test Modules in the main REPL. It’s definitely not user-friendly right now, but it looks like it’s possible to get it working (especially if the likes of me can figure it out) in a nice way.
