Using shared data source (1.0.78) #3803
Unanswered
JaneMalico
asked this question in
Q&A
Replies: 1 comment 4 replies
-
|
@JaneMalico Try v1.1.0 |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment





Uh oh!
There was an error while loading. Please reload this page.
-
I want each test to have its own instance of WebApplicationFactory (so I can mock different behaviors per test) while sharing instances of the test containers, since they are resource-heavy.
To inject the test container instances, I use ClassDataSourceAttribute with SharedType.PerTestSession. My understanding is that the containers should be initialized only once per test session (i.e. be shared among test method defined in the same class).
However, it seems that each test starts its own instance of the test container instead. Am I missing something?
1)The test container classes look as follows
I have two tests that each create their own containers, even when run in the same session.


When I downgrade TUnit to version 0.67.19, only one instance of each container is created - which appears to be the expected behavior
Beta Was this translation helpful? Give feedback.
All reactions