Skip to content

Commit

Permalink
Skip using tmp_env in older conda
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodegard committed Dec 12, 2023
1 parent 3f19216 commit f955083
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/test_inspect_pkg.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
# Copyright (C) 2014 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations

import pytest
from conda import __version__ as conda_version
from conda.core.prefix_data import PrefixData
from conda.testing import TmpEnvFixture
from packaging.version import Version, parse

from conda_build.inspect_pkg import which_package

if TYPE_CHECKING := False:
from conda.testing import TmpEnvFixture


@pytest.mark.skipif(
parse(conda_version) < Version("23.5.0"),
reason="tmp_env fixture first available in conda 23.5.0",
)
def test_which_package(tmp_env: TmpEnvFixture):
with tmp_env("ca-certificates") as prefix:
pd = PrefixData(prefix)
Expand Down

0 comments on commit f955083

Please sign in to comment.