# \#exunit

**URL:** https://forum.elixirforum.com/tag/exunit/141.md

[Latest](https://forum.elixirforum.com/latest.md) · [Categories](https://forum.elixirforum.com/categories.md) · [Tags](https://forum.elixirforum.com/tags.md)

---

## [SeedFactory - a toolkit for test data generation](https://forum.elixirforum.com/t/seedfactory-a-toolkit-for-test-data-generation/62536)

<div class="topic-metadata">

**Author:** [@fuelen](https://forum.elixirforum.com/u/fuelen)\
**Replies:** 9\
**Last updated:** [September 12, 2026, 6:49am UTC](https://forum.elixirforum.com/t/seedfactory-a-toolkit-for-test-data-generation/62536 "2026-09-12T06:49:23Z")

</div>

SeedFactory - a toolkit for test data generation GitHub | docs | Hex.pm The main idea of SeedFactory is to generate test data by calling your application’s business logic (context functions if you use Phoenix Contexts) …

---

## [Each tests should own its setup](https://forum.elixirforum.com/t/each-tests-should-own-its-setup/76103)

<div class="topic-metadata">

**Author:** [@ryanzidago](https://forum.elixirforum.com/u/ryanzidago)\
**Replies:** 7\
**Last updated:** [July 26, 2026, 8:22am UTC](https://forum.elixirforum.com/t/each-tests-should-own-its-setup/76103 "2026-07-26T08:22:48Z")

</div>

Hi all, In this article, I make the case for each test owning its setup. Usually I forbid my AI agents to use the setup callbacks; I much prefer when tests are portable. For example at work during code reviews, I oft…

---

## [How do I write Elixir tests?](https://forum.elixirforum.com/t/how-do-i-write-elixir-tests/75335)

<div class="topic-metadata">

**Author:** [@hauleth](https://forum.elixirforum.com/u/hauleth)\
**Replies:** 41\
**Last updated:** [May 18, 2026, 10:41pm UTC](https://forum.elixirforum.com/t/how-do-i-write-elixir-tests/75335 "2026-05-18T22:41:02Z")

</div>

I wanted to write down some of the main guides I use when writing Elixir tests, so I have summarised them in blogpost. Furthermore, I think that mocking must be destroyed.

---

## [Testcontainers - A Testcontainers implementation for Elixir](https://forum.elixirforum.com/t/testcontainers-a-testcontainers-implementation-for-elixir/59516)

<div class="topic-metadata">

**Author:** [@jarlah](https://forum.elixirforum.com/u/jarlah)\
**Replies:** 41\
**Last updated:** [March 16, 2026, 5:06pm UTC](https://forum.elixirforum.com/t/testcontainers-a-testcontainers-implementation-for-elixir/59516 "2026-03-16T17:06:42Z")

</div>

Testcontainers Testcontainers is an Elixir library that supports ExUnit tests, providing lightweight, throwaway instances of common databases, or anything else that can run in a Docker container. It supports Testcontain…

---

## [How to make warning for misnamed test files blocking?](https://forum.elixirforum.com/t/how-to-make-warning-for-misnamed-test-files-blocking/74350)

<div class="topic-metadata">

**Author:** [@Gladear](https://forum.elixirforum.com/u/Gladear)\
**Replies:** 2\
**Last updated:** [February 17, 2026, 12:55pm UTC](https://forum.elixirforum.com/t/how-to-make-warning-for-misnamed-test-files-blocking/74350 "2026-02-17T12:55:21Z")

</div>

Hi ! We just stumbled upon this warning: “warning: the following files do not match any of the configured \`:test\_load\_filters\` / \`:test\_ignore\_filters\`". Unfortunately, the deed was done, the CI did not block it and th…

---

## [Elixir for implementing system test framework for a non-Elixir database](https://forum.elixirforum.com/t/elixir-for-implementing-system-test-framework-for-a-non-elixir-database/74335)

<div class="topic-metadata">

**Author:** [@mpoeter](https://forum.elixirforum.com/u/mpoeter)\
**Replies:** 1\
**Last updated:** [February 16, 2026, 9:09pm UTC](https://forum.elixirforum.com/t/elixir-for-implementing-system-test-framework-for-a-non-elixir-database/74335 "2026-02-16T21:09:59Z")

</div>

I am working for ArangoDB, a multi-model database implemented in C++. We have a huge number of integration/system tests that are written in JavaScript using a custom fully synchronous V8 implementation (no nodejs), and t…

---

## [100 Percent Code Coverage Is Not as Good as You Think](https://forum.elixirforum.com/t/100-percent-code-coverage-is-not-as-good-as-you-think/74326)

<div class="topic-metadata">

**Author:** [@matt-savvy](https://forum.elixirforum.com/u/matt-savvy)\
**Replies:** 0\
**Last updated:** [February 16, 2026, 12:21am UTC](https://forum.elixirforum.com/t/100-percent-code-coverage-is-not-as-good-as-you-think/74326 "2026-02-16T00:21:03Z")

</div>

Why 100% code coverage is a misleading metric and a false sense of security.

---

## [Is it possible to mark tests as incomplete or skipped in ExUnit?](https://forum.elixirforum.com/t/is-it-possible-to-mark-tests-as-incomplete-or-skipped-in-exunit/9400)

<div class="topic-metadata">

**Author:** [@sebastiandedeyne](https://forum.elixirforum.com/u/sebastiandedeyne)\
**Replies:** 12\
**Last updated:** [December 30, 2025, 11:38pm UTC](https://forum.elixirforum.com/t/is-it-possible-to-mark-tests-as-incomplete-or-skipped-in-exunit/9400 "2025-12-30T23:38:19Z")

</div>

Title says all! Is it possible to manually mark tests as incomplete or skipped in ExUnit, in the middle of a test case?

---

## [Nvim-exunit - an ExUnit NeoVim plugin](https://forum.elixirforum.com/t/nvim-exunit-an-exunit-neovim-plugin/73645)

<div class="topic-metadata">

**Author:** [@hq1](https://forum.elixirforum.com/u/hq1)\
**Replies:** 4\
**Last updated:** [December 15, 2025, 9:20pm UTC](https://forum.elixirforum.com/t/nvim-exunit-an-exunit-neovim-plugin/73645 "2025-12-15T21:20:12Z")

</div>

Hey! Just wanted to share my ExUnit NeoVim plugin: GitHub - aerosol/nvim-exunit: Opinionated ExUnit test runner for NeoVim · GitHub There are probably more sophisticated/general TDD plugins out there. This one is somew…

---

## [capture\_logger - ExUnit.CaptureLog with alternate formatter support](https://forum.elixirforum.com/t/capture-logger-exunit-capturelog-with-alternate-formatter-support/73319)

<div class="topic-metadata">

**Author:** [@halostatue](https://forum.elixirforum.com/u/halostatue)\
**Replies:** 2\
**Last updated:** [November 16, 2025, 4:16am UTC](https://forum.elixirforum.com/t/capture-logger-exunit-capturelog-with-alternate-formatter-support/73319 "2025-11-16T04:16:02Z")

</div>

I’ve published CaptureLogger 1.0, a very light modification to ExUnit.CaptureLogger (mostly to ExUnit.CaptureServer) that supports passing a formatter to be used instead of Logger.default\_formatter/0. This allows testing…

---

## [Structured output for ExUnit tests in GitHub actions](https://forum.elixirforum.com/t/structured-output-for-exunit-tests-in-github-actions/43786)

<div class="topic-metadata">

**Author:** [@axelson](https://forum.elixirforum.com/u/axelson)\
**Replies:** 4\
**Last updated:** [November 2, 2025, 6:35am UTC](https://forum.elixirforum.com/t/structured-output-for-exunit-tests-in-github-actions/43786 "2025-11-02T06:35:54Z")

</div>

Is anyone using any sort of tool to produce machine readable output from exunit when using GitHub actions? In the past with CircleCI I’ve used GitHub - victorolinasc/junit-formatter: A JUnit XML report exporter for Elix…

---

## [Would you enable ExUnit's \`--trace\` option in a CI environment (GitHub)? (poll)](https://forum.elixirforum.com/t/would-you-enable-exunits-trace-option-in-a-ci-environment-github-poll/73049)

<div class="topic-metadata">

**Author:** [@b1az](https://forum.elixirforum.com/u/b1az)\
**Replies:** 4\
**Last updated:** [October 23, 2025, 4:28pm UTC](https://forum.elixirforum.com/t/would-you-enable-exunits-trace-option-in-a-ci-environment-github-poll/73049 "2025-10-23T16:28:00Z")

</div>

Coworker and I are at an impasse and would appreciate the community’s vote to resolve it. :slight\_smile: poll Elixir’s test-runner has a --trace option which does the following: it discards all of Elixir’s concurrency…

---

## [ExUnit: Expected behaviour with :group + :async true + :parameterize?](https://forum.elixirforum.com/t/exunit-expected-behaviour-with-group-async-true-parameterize/72444)

<div class="topic-metadata">

**Author:** [@pajawa](https://forum.elixirforum.com/u/pajawa)\
**Replies:** 1\
**Last updated:** [September 10, 2025, 5:26am UTC](https://forum.elixirforum.com/t/exunit-expected-behaviour-with-group-async-true-parameterize/72444 "2025-09-10T05:26:23Z")

</div>

I am trying to run a parameterize’d test with both a :group set and async: true. The ExUnit docs state: “If both :async and :parameterize are given, the different parameters run concurrently”. I would expect this to st…

---

## [Things I've realized about testing Elixir code](https://forum.elixirforum.com/t/things-ive-realized-about-testing-elixir-code/72307)

<div class="topic-metadata">

**Author:** [@waseigo](https://forum.elixirforum.com/u/waseigo)\
**Replies:** 0\
**Last updated:** [August 31, 2025, 8:54pm UTC](https://forum.elixirforum.com/t/things-ive-realized-about-testing-elixir-code/72307 "2025-08-31T20:54:22Z")

</div>

Use IEx before ExUnit, don’t test private functions, test what matters, test the contracts, avoid dogma

---

## [Generating separate tests with for - how to make a controller test to validate mandatory fields?](https://forum.elixirforum.com/t/generating-separate-tests-with-for-how-to-make-a-controller-test-to-validate-mandatory-fields/72289)

<div class="topic-metadata">

**Author:** [@williamthewill](https://forum.elixirforum.com/u/williamthewill)\
**Replies:** 1\
**Last updated:** [August 29, 2025, 9:30pm UTC](https://forum.elixirforum.com/t/generating-separate-tests-with-for-how-to-make-a-controller-test-to-validate-mandatory-fields/72289 "2025-08-29T21:30:05Z")

</div>

Hi everyone! I need make a controller tests to validate mandatory fields. In this case the tests is the same for all fieds and the validation too. Use a loop to generate the same test for different values is wrong? En…

---

## [ExUnitSpan - An ExUnit formatter to visualize test execution](https://forum.elixirforum.com/t/exunitspan-an-exunit-formatter-to-visualize-test-execution/45102)

<div class="topic-metadata">

**Author:** [@ananthakumaran](https://forum.elixirforum.com/u/ananthakumaran)\
**Replies:** 3\
**Last updated:** [August 7, 2025, 12:47pm UTC](https://forum.elixirforum.com/t/exunitspan-an-exunit-formatter-to-visualize-test-execution/45102 "2025-08-07T12:47:06Z")

</div>

An ExUnit formatter to visualize test execution and find bottlenecks in your test suite. I created a small library called ex\_unit\_span to generate a trace file for ExUnit tests. The idea is to get a quick overview of…

---

## [What is the optimal --max-requires option for tests?](https://forum.elixirforum.com/t/what-is-the-optimal-max-requires-option-for-tests/72001)

<div class="topic-metadata">

**Author:** [@senconscious](https://forum.elixirforum.com/u/senconscious)\
**Replies:** 0\
**Last updated:** [August 7, 2025, 10:51am UTC](https://forum.elixirforum.com/t/what-is-the-optimal-max-requires-option-for-tests/72001 "2025-08-07T10:51:14Z")

</div>

Hello everyone, I have encountered a strange bottleneck when trying to run tests. The execution time of specific tests was increasing according to the number of schedulers online: each scheduler added about 100ms to the…

---

## [Testing "seam" in Elixir](https://forum.elixirforum.com/t/testing-seam-in-elixir/70397)

<div class="topic-metadata">

**Author:** [@lessless](https://forum.elixirforum.com/u/lessless)\
**Replies:** 20\
**Last updated:** [August 5, 2025, 10:45pm UTC](https://forum.elixirforum.com/t/testing-seam-in-elixir/70397 "2025-08-05T22:45:06Z")

</div>

I wonder if it’s possible to mimic a simple “class reopening”/inhertinace-based SEAM in Elixir to alter a module’s behaviour without editing its code. Here is an example in pseudo-Ruby class PriceCalculator def …

---

## [allure\_test\_formatter - Allure test report for ExUnit](https://forum.elixirforum.com/t/allure-test-formatter-allure-test-report-for-exunit/71851)

<div class="topic-metadata">

**Author:** [@wingyplus](https://forum.elixirforum.com/u/wingyplus)\
**Replies:** 2\
**Last updated:** [July 28, 2025, 4:25pm UTC](https://forum.elixirforum.com/t/allure-test-formatter-allure-test-report-for-exunit/71851 "2025-07-28T16:25:24Z")

</div>

Hi, I would like to introduced allure\_test\_formatter, the Allure test report for ExUnit using ExUnit Test Formatter. The usage is simple, just add the library to your application and set --formatter AllureTestFormatter …

---

## [Removing ExUnit.start() still runs the tests](https://forum.elixirforum.com/t/removing-exunit-start-still-runs-the-tests/71811)

<div class="topic-metadata">

**Author:** [@lud](https://forum.elixirforum.com/u/lud)\
**Replies:** 1\
**Last updated:** [July 24, 2025, 6:00pm UTC](https://forum.elixirforum.com/t/removing-exunit-start-still-runs-the-tests/71811 "2025-07-24T18:00:06Z")

</div>

Hello, I was trying to figure out why my logger configuration is not used when running the tests with mix test --no-start and a manual app start. (I found out we must restart the logger application). And while debuggin…

---

## [Mix test feature: shortcut to run last tests?](https://forum.elixirforum.com/t/mix-test-feature-shortcut-to-run-last-tests/70978)

<div class="topic-metadata">

**Author:** [@tcoopman](https://forum.elixirforum.com/u/tcoopman)\
**Replies:** 4\
**Last updated:** [May 24, 2025, 9:32am UTC](https://forum.elixirforum.com/t/mix-test-feature-shortcut-to-run-last-tests/70978 "2025-05-24T09:32:56Z")

</div>

some context, I’m running helix+tmux and have some shortcuts to run my tests. I’ve configured some shortcuts like: run line, run file, run all, run stale, run failed tests. I’d like to be able to have a shortcut: run la…

---

## [ExUnit wish - retrospective \`:test\` env logger level](https://forum.elixirforum.com/t/exunit-wish-retrospective-test-env-logger-level/70344)

<div class="topic-metadata">

**Author:** [@slouchpie](https://forum.elixirforum.com/u/slouchpie)\
**Replies:** 7\
**Last updated:** [April 8, 2025, 5:40pm UTC](https://forum.elixirforum.com/t/exunit-wish-retrospective-test-env-logger-level/70344 "2025-04-08T17:40:11Z")

</div>

In :test env I have the usual logger config :point\_down: # Print only warnings and errors during test config :logger, level: :warning which means I have a nice clean console if everything passes (and I use capture\_log …

---

## [I can't get actual code location (line/column) from macros used in tests](https://forum.elixirforum.com/t/i-cant-get-actual-code-location-line-column-from-macros-used-in-tests/38554)

<div class="topic-metadata">

**Author:** [@lud](https://forum.elixirforum.com/u/lud)\
**Replies:** 8\
**Last updated:** [April 7, 2025, 6:00pm UTC](https://forum.elixirforum.com/t/i-cant-get-actual-code-location-line-column-from-macros-used-in-tests/38554 "2025-04-07T18:00:01Z")

</div>

I’m trying to build a protocol and a test suite to implement different adapters (impls of the protocol). I tried to use a CaseTemplate, or just regular macros, but all tests defined inside quote location: :keep ... will…

---

## [Mix test hides console output text with black on black colorization?](https://forum.elixirforum.com/t/mix-test-hides-console-output-text-with-black-on-black-colorization/47229)

<div class="topic-metadata">

**Author:** [@rvnash](https://forum.elixirforum.com/u/rvnash)\
**Replies:** 3\
**Last updated:** [April 4, 2025, 6:26pm UTC](https://forum.elixirforum.com/t/mix-test-hides-console-output-text-with-black-on-black-colorization/47229 "2025-04-04T18:26:08Z")

</div>

While working on my unit tests running mix test I got this failure: I selected the failure information to copy and paste it to a text editor for reference later and I saw this: So apparently mix test is colorizin…

---

## [How-to: Async tests with application env.](https://forum.elixirforum.com/t/how-to-async-tests-with-application-env/67222)

<div class="topic-metadata">

**Author:** [@Asd](https://forum.elixirforum.com/u/Asd)\
**Replies:** 1\
**Last updated:** [March 9, 2025, 7:28pm UTC](https://forum.elixirforum.com/t/how-to-async-tests-with-application-env/67222 "2025-03-09T19:28:44Z")

</div>

How to test with application env in async: true It is quite common for Elixir application to be configured via application env (which is set in config/ files and accessed with Application.get\_env and such). However, this…

---

## [Test order is not deterministic despite using a seed](https://forum.elixirforum.com/t/test-order-is-not-deterministic-despite-using-a-seed/69825)

<div class="topic-metadata">

**Author:** [@lud](https://forum.elixirforum.com/u/lud)\
**Replies:** 6\
**Last updated:** [March 8, 2025, 9:35pm UTC](https://forum.elixirforum.com/t/test-order-is-not-deterministic-despite-using-a-seed/69825 "2025-03-08T21:35:25Z")

</div>

When using this command: mix test --failed --max-failures 1 --seed 0 --trace Mix alternates between two tests, always the same two. It looks like it may be clock based as the test changes every 1 or 2 seconds (hard to …

---

## [Parameterized testing and setup block](https://forum.elixirforum.com/t/parameterized-testing-and-setup-block/69290)

<div class="topic-metadata">

**Author:** [@zwippie](https://forum.elixirforum.com/u/zwippie)\
**Replies:** 4\
**Last updated:** [February 8, 2025, 2:48pm UTC](https://forum.elixirforum.com/t/parameterized-testing-and-setup-block/69290 "2025-02-08T14:48:47Z")

</div>

Given this simplified application code: defmodule Bla do def hello(name), do: "Hello #{name}" end And this test code: defmodule BlaTest do use ExUnit.Case defp user(\_), do: {:ok, name: "User"} defp admin(\_), …

---

## [Including ExUnit in a release to use Wallaby](https://forum.elixirforum.com/t/including-exunit-in-a-release-to-use-wallaby/38422)

<div class="topic-metadata">

**Author:** [@jswny](https://forum.elixirforum.com/u/jswny)\
**Replies:** 4\
**Last updated:** [January 21, 2025, 2:26pm UTC](https://forum.elixirforum.com/t/including-exunit-in-a-release-to-use-wallaby/38422 "2025-01-21T14:26:42Z")

</div>

I’m using the following library: GitHub - elixir-wallaby/wallaby: Concurrent browser tests for your Elixir web apps. · GitHub However, this library is meant for testing only and calls ExUnit functions directly. I’m usin…

---

## [How to get --warnings-as-errors in tests?](https://forum.elixirforum.com/t/how-to-get-warnings-as-errors-in-tests/64342)

<div class="topic-metadata">

**Author:** [@schnittchen](https://forum.elixirforum.com/u/schnittchen)\
**Replies:** 2\
**Last updated:** [January 8, 2025, 7:41pm UTC](https://forum.elixirforum.com/t/how-to-get-warnings-as-errors-in-tests/64342 "2025-01-08T19:41:50Z")

</div>

I’d like to get compiler warnings as errors in my tests, because in my experience, such warnings quite often uncover real bugs. What I’ve tried before: alias configuration in mix.exs, which exactly I forgot test\_elixi…

---

## [ExUnitExt - A small extension for ExUnit that adds a few extra features.](https://forum.elixirforum.com/t/exunitext-a-small-extension-for-exunit-that-adds-a-few-extra-features/68111)

<div class="topic-metadata">

**Author:** [@Marcus](https://forum.elixirforum.com/u/Marcus)\
**Replies:** 0\
**Last updated:** [December 15, 2024, 12:12pm UTC](https://forum.elixirforum.com/t/exunitext-a-small-extension-for-exunit-that-adds-a-few-extra-features/68111 "2024-12-15T12:12:38Z")

</div>

ExUnitExt is in alpha state for now. The package changes the output of mix test. All failed tests are only displayed once the entire suite has been run. Between the green . for the successful tests, a ! is displayed for …

[Next page](https://forum.elixirforum.com/tag/exunit/141.md?match_all_tags=true&page=1&tags%5B%5D=exunit)
