Skip to content

Commit 58d29bf

Browse files
committed
pytest
1 parent 2962b81 commit 58d29bf

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

python/plugin.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
# Description: A plugin to help users Define, Use, and Research words.
33
# Last Change: 2nd November 2024
44
# Maintainer: klebster2 <https://github.com/klebster2>
5+
import os
56
import subprocess
67
import sys
7-
import os
8+
89

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

2124
try:
2225
import wn
@@ -32,7 +35,9 @@ def install(package: str):
3235
if "PYTEST_CURRENT_TEST" in os.environ:
3336
ARTEFACT_NAME = LANGUAGE_TO_WORDNET_ARTEFACT["mul"]
3437
else:
35-
ARTEFACT_NAME = LANGUAGE_TO_WORDNET_ARTEFACT.get(vim.eval("g:wn_cmp_language"), "mul")
38+
ARTEFACT_NAME = LANGUAGE_TO_WORDNET_ARTEFACT.get(
39+
vim.eval("g:wn_cmp_language"), "mul" # type: ignore
40+
)
3641

3742
try:
3843
spec = wn.Wordnet(ARTEFACT_NAME)

0 commit comments

Comments
 (0)