Skip to content

Commit

Permalink
fix pkg_resources deprecation warning (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
ViZiD committed Mar 21, 2024
1 parent e4e4dbd commit b0298f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ editdistpy>=0.1.3
coverage==6.1.2
numpy>=1.19.5
pytest-cov==3.0.0
importlib-resources>=6.3.2
17 changes: 8 additions & 9 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
from pathlib import Path

import pkg_resources
import importlib_resources
import pytest

from symspellpy import SymSpell
Expand All @@ -13,17 +13,15 @@
#######################################################################
@pytest.fixture
def bigram_path():
return pkg_resources.resource_filename(
"symspellpy", "frequency_bigramdictionary_en_243_342.txt"
)

ref = importlib_resources.files("symspellpy") / "frequency_bigramdictionary_en_243_342.txt"
with importlib_resources.as_file(ref) as path:
yield path

@pytest.fixture
def dictionary_path():
return pkg_resources.resource_filename(
"symspellpy", "frequency_dictionary_en_82_765.txt"
)

ref = importlib_resources.files("symspellpy") / "frequency_dictionary_en_82_765.txt"
with importlib_resources.as_file(ref) as path:
yield path

@pytest.fixture
def pickle_path():
Expand Down Expand Up @@ -90,3 +88,4 @@ def symspell_short(request):
if request.param is None:
return SymSpell(1, 3)
return SymSpell(1, 3, count_threshold=request.param)

0 comments on commit b0298f4

Please sign in to comment.