Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yethee committed May 14, 2024
1 parent def176a commit 64cf0a3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/Vocab/Loader/DefaultVocabLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use function copy;
use function dirname;
use function file_exists;
use function file_put_contents;
use function hash;
use function rmdir;
Expand Down Expand Up @@ -57,8 +58,6 @@ public function testInvalidateCacheWhenChecksumMismatch(): void
protected function setUp(): void
{
$this->cacheDir = sys_get_temp_dir() . '/tiktoken-test';

self::removeDir($this->cacheDir);
}

protected function tearDown(): void
Expand All @@ -68,6 +67,10 @@ protected function tearDown(): void

private static function removeDir(string $path): void
{
if (! file_exists($path)) {
return;
}

$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS),
RecursiveIteratorIterator::CHILD_FIRST,
Expand Down

0 comments on commit 64cf0a3

Please sign in to comment.