mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Fix skipped collection of pytest integration test files
On integration tests file collection, the value of `environment.executable` can also be a symlink (e.g. in a virtualenv) with a different name than, but pointing to the same as `sys.executable` (e.g. .../bin/python3.10 and .../bin/python, respectively). That causes skipping the collection of `completion/pytest.py` and `completion/conftest.py` a lot of times, depending on the environment. (e.g. "60 skipped" before x "23 skipped" after, in a local virtualenv)
This commit is contained in:
@@ -209,7 +209,7 @@ class IntegrationTestCase(BaseTestCase):
|
||||
TEST_REFERENCES: self.run_get_references,
|
||||
}
|
||||
if (self.path.endswith('pytest.py') or self.path.endswith('conftest.py')) \
|
||||
and environment.executable != os.path.realpath(sys.executable):
|
||||
and os.path.realpath(environment.executable) != os.path.realpath(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.
|
||||
|
||||
Reference in New Issue
Block a user