-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove unneeded code, we now require PyTest >= 7.1
Signed-off-by: Pedro Algarvio <[email protected]>
- Loading branch information
Showing
1 changed file
with
1 addition
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,4 @@ | ||
# Copyright 2021-2023 VMware, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
import pytest | ||
|
||
try: # pragma: no cover | ||
import importlib.metadata | ||
|
||
pkg_version = importlib.metadata.version | ||
except ImportError: # pragma: no cover | ||
try: | ||
import importlib_metadata | ||
|
||
pkg_version = importlib_metadata.version | ||
except ImportError: # pragma: no cover | ||
import pkg_resources | ||
|
||
def pkg_version(package): | ||
return pkg_resources.get_distribution(package).version | ||
|
||
|
||
def pkg_version_info(package): | ||
return tuple(int(part) for part in pkg_version(package).split(".") if part.isdigit()) | ||
|
||
|
||
if pkg_version_info("pytest") >= (6, 2): | ||
pytest_plugins = ["pytester"] | ||
else: | ||
|
||
@pytest.fixture | ||
def pytester(): | ||
pytest.skip("The pytester fixture is not available in Pytest < 6.2.0") | ||
pytest_plugins = ["pytester"] |