mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
Skip pytest tests when environments is not the same one
This commit is contained in:
@@ -118,6 +118,8 @@ from io import StringIO
|
|||||||
from functools import reduce
|
from functools import reduce
|
||||||
|
|
||||||
import parso
|
import parso
|
||||||
|
from _pytest.outcomes import Skipped
|
||||||
|
import pytest
|
||||||
|
|
||||||
import jedi
|
import jedi
|
||||||
from jedi import debug
|
from jedi import debug
|
||||||
@@ -204,6 +206,11 @@ class IntegrationTestCase(BaseTestCase):
|
|||||||
TEST_GOTO: self.run_goto,
|
TEST_GOTO: self.run_goto,
|
||||||
TEST_REFERENCES: self.run_find_references,
|
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)
|
return testers[self.test_type](compare_cb, environment)
|
||||||
|
|
||||||
def run_completion(self, compare_cb, environment):
|
def run_completion(self, compare_cb, environment):
|
||||||
@@ -513,6 +520,8 @@ if __name__ == '__main__':
|
|||||||
if arguments['--pdb']:
|
if arguments['--pdb']:
|
||||||
import pdb
|
import pdb
|
||||||
pdb.post_mortem()
|
pdb.post_mortem()
|
||||||
|
except Skipped:
|
||||||
|
pass
|
||||||
|
|
||||||
count += 1
|
count += 1
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user