Skip to content

Commit c06e2e0

Browse files
committed
TestDbContext providers should dispose logging options.
1 parent 8ccc143 commit c06e2e0

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/Thinktecture.EntityFrameworkCore.SqlServer.Testing/EntityFrameworkCore/Testing/SqlServerTestDbContextProvider.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ protected virtual void Dispose(bool disposing)
221221
}
222222

223223
_masterConnection.Dispose();
224+
_testingLoggingOptions.Dispose();
224225
}
225226

226227
private void DisposeContextsAndRollbackMigrations()

src/Thinktecture.EntityFrameworkCore.Sqlite.Testing/EntityFrameworkCore/Testing/SqliteTestDbContextProvider.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ protected virtual void RunMigrations(T ctx)
133133
lock (_lock)
134134
{
135135
var logLevel = LogLevelSwitch.MinimumLogLevel;
136+
136137
try
137138
{
138139
LogLevelSwitch.MinimumLogLevel = _testingLoggingOptions.MigrationLogLevel;
@@ -172,6 +173,7 @@ protected virtual void Dispose(bool disposing)
172173
}
173174

174175
_masterConnection.Dispose();
176+
_testingLoggingOptions.Dispose();
175177
}
176178

177179
private void DisposeContexts()

0 commit comments

Comments
 (0)