Skip to content

Commit

Permalink
Checking if Sldr is initialized before each test in SldrTests
Browse files Browse the repository at this point in the history
This may possibly fix some test flakiness with Sldr. The initialize is also present in the TestEnvironment, but this isn't constructed in every test. By initializing in the SetUp, we guarantee it is. Certainly tests outside this class have been flaky, but I haven't seen any failures in 4-5 runs with this fix.
  • Loading branch information
josephmyers committed Sep 5, 2024
1 parent d177adb commit 2ec7dc2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions SIL.WritingSystems.Tests/SldrTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ public void Dispose()
}
}

[SetUp]
public void Setup()
{
if (!Sldr.IsInitialized)
Sldr.Initialize(true, Sldr.DefaultSldrCachePath);
}

[Test]
public void GetLdmlFile_EmptyPath_Throws()
{
Expand Down

0 comments on commit 2ec7dc2

Please sign in to comment.