Skip to content

Commit

Permalink
Remove unneeded code, we now require PyTest >= 7.1
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Algarvio <[email protected]>
  • Loading branch information
s0undt3ch committed Oct 20, 2023
1 parent 977dc48 commit 7e0dd92
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions tests/conftest.py
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"]

0 comments on commit 7e0dd92

Please sign in to comment.