Skip to content

Commit

Permalink
move directory creator to test setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ajslater committed Feb 5, 2022
1 parent 50258e6 commit 0d23dac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 5 additions & 0 deletions tests/xapian_tests/tests/test_backend.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from decimal import Decimal
import datetime
import inspect
from pathlib import Path
import sys
import xapian
import subprocess
Expand Down Expand Up @@ -72,6 +73,10 @@ def setUp(self):
self.ui.build(indexes=[self.index])
self.backend = connections['default'].get_backend()
connections['default']._index = self.ui
try:
Path(self.backend.path).mkdir(parents=True)
except FileExistsError:
pass

def tearDown(self):
self.backend.clear()
Expand Down
5 changes: 0 additions & 5 deletions tests/xapian_tests/tests/test_management_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import random
from decimal import Decimal
from io import StringIO
from pathlib import Path
from unittest import TestCase

from django.core.management import call_command
Expand Down Expand Up @@ -46,10 +45,6 @@ def setUp(self):
self.sample_objs.append(entry)
entry.save()

try:
Path(self.backend.path).mkdir(parents=True)
except FileExistsError:
pass
self.backend.update(self.index, BlogEntry.objects.all())

def verify_indexed_document_count(self, expected):
Expand Down

0 comments on commit 0d23dac

Please sign in to comment.