Skip to content

Commit

Permalink
pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
klebster2 committed Nov 2, 2024
1 parent 2962b81 commit 58d29bf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
# Description: A plugin to help users Define, Use, and Research words.
# Last Change: 2nd November 2024
# Maintainer: klebster2 <https://github.com/klebster2>
import os
import subprocess
import sys
import os


def install(package: str):
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
Expand All @@ -17,6 +18,8 @@ def install(package: str):
except Exception as e:
print("No vim module available outside vim")
raise e
else:
vim = None # type: ignore

try:
import wn
Expand All @@ -32,7 +35,9 @@ def install(package: str):
if "PYTEST_CURRENT_TEST" in os.environ:
ARTEFACT_NAME = LANGUAGE_TO_WORDNET_ARTEFACT["mul"]
else:
ARTEFACT_NAME = LANGUAGE_TO_WORDNET_ARTEFACT.get(vim.eval("g:wn_cmp_language"), "mul")
ARTEFACT_NAME = LANGUAGE_TO_WORDNET_ARTEFACT.get(
vim.eval("g:wn_cmp_language"), "mul" # type: ignore
)

try:
spec = wn.Wordnet(ARTEFACT_NAME)
Expand Down

0 comments on commit 58d29bf

Please sign in to comment.