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 58d29bf commit 8139e63
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Last Change: 2nd November 2024
# Maintainer: klebster2 <https://github.com/klebster2>
import os
import re
import subprocess
import sys

Expand All @@ -11,8 +12,7 @@ def install(package: str):
subprocess.check_call([sys.executable, "-m", "pip", "install", package])


if "PYTEST_CURRENT_TEST" in os.environ:
# This is the quick and dirty way to get packages installed if they are not already installed
if not any(re.findall(r"pytest|py.test", sys.argv[0])):
try:
import vim # pylint: disable=import-error
except Exception as e:
Expand All @@ -21,6 +21,7 @@ def install(package: str):
else:
vim = None # type: ignore

# This is the quick and dirty way to get packages installed if they are not already installed
try:
import wn
except ImportError:
Expand Down

0 comments on commit 8139e63

Please sign in to comment.