From 73161fe72e39833984e610f781aeda3b1bcc9eec Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Fri, 27 Dec 2019 16:54:11 +0100 Subject: [PATCH] Skip pytest tests when environments is not the same one --- test/run.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/run.py b/test/run.py index 59c42ea8..a91dc679 100755 --- a/test/run.py +++ b/test/run.py @@ -118,6 +118,8 @@ from io import StringIO from functools import reduce import parso +from _pytest.outcomes import Skipped +import pytest import jedi from jedi import debug @@ -204,6 +206,11 @@ class IntegrationTestCase(BaseTestCase): TEST_GOTO: self.run_goto, TEST_REFERENCES: self.run_find_references, } + if self.path.endswith('pytest.py') and environment.executable != sys.executable: + # It's not guarantueed that pytest is installed in test + # environments, if we're not running in the same environment that + # we're already in, so just skip that case. + pytest.skip() return testers[self.test_type](compare_cb, environment) def run_completion(self, compare_cb, environment): @@ -513,6 +520,8 @@ if __name__ == '__main__': if arguments['--pdb']: import pdb pdb.post_mortem() + except Skipped: + pass count += 1