repo stringclasses 454
values | file_path stringlengths 5 201 | extension stringclasses 1
value | content stringlengths 8 509k | num_lines int64 3 16.9k | size_bytes int64 8 511k |
|---|---|---|---|---|---|
conda | tests/testing/test_fixtures.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from conda.base.context import context, reset_context
from conda.core.prefix_data import PrefixData
if TYPE_CHECKING:
from pathlib import Path
from py... | 244 | 7,422 |
conda | tests/base/test_constants.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from contextlib import nullcontext
from logging import getLogger
import pytest
from conda.base import constants
from conda.base.constants import ChannelPriority
from conda.common.constants import NULL
log = getLogger(__name__)
def test_null... | 38 | 1,076 |
conda | tests/base/test_context.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import os
from argparse import Namespace
from contextlib import nullcontext
from itertools import chain
from os.path import abspath, join
from types import SimpleNamespace
from typing import TYPE_CHECKING
fro... | 1,060 | 34,824 |
conda | tests/gateways/test_zstd.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
Test that SubdirData is able to use zstd repodata downloads.
"""
import json
from pathlib import Path
from socket import socket
import pytest
import requests
from pytest import MonkeyPatch
import conda.gateways.repodata
from conda._privat... | 266 | 7,925 |
conda | tests/gateways/test_subprocess.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
import pytest
from pytest import CaptureFixture
from conda.gateways.subprocess import subprocess_call, subprocess_call_with_clean_env
def test_subprocess_call_without_capture_output(capfd: CaptureFixture):
resp = subprocess_call(
... | 54 | 1,546 |
conda | tests/gateways/test_repodata_shards.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
Test bytes cache used for sharded repodata.
"""
from pathlib import Path
from conda.gateways.repodata import FORMAT_JSON, FORMAT_SHARDS, RepodataCache
def test_bytes_cache(tmp_path: Path):
"""
Test caching bytes in a separate ".m... | 46 | 1,459 |
conda | tests/gateways/test_logging.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
import logging
import os
import sys
from logging import getLogger
from pathlib import Path
from subprocess import run
import pytest
from conda.auxlib.ish import dals
from conda.gateways.logging import (
TokenURLFilter,
initialize_loggi... | 192 | 6,064 |
conda | tests/gateways/test_connection.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import hashlib
from contextlib import nullcontext
from importlib.util import find_spec
from logging import getLogger
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from requests impor... | 746 | 25,401 |
conda | tests/gateways/test_repodata_gateway.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
Strongly related to subdir_data / test_subdir_data.
"""
from __future__ import annotations
import datetime
import json
import math
import sys
import time
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from conda.... | 529 | 16,138 |
conda | tests/gateways/test_repodata_lock.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import multiprocessing
import sys
import traceback
from typing import TYPE_CHECKING
import pytest
from conda.base.context import context, reset_context
from conda.common.compat import on_win
from conda.gatew... | 100 | 3,136 |
conda | tests/gateways/test_streams.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from typing import TYPE_CHECKING
from conda.gateways.logging import TokenURLFilter
from conda.gateways.streams import redact_token_urls, stderr, stdout
if TYPE_CHECKING:
from pytest import CaptureFixture... | 28 | 963 |
conda | tests/gateways/disk/test_permissions.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
import errno
import os
import uuid
from contextlib import contextmanager
from errno import EACCES, ENOENT, EPERM, EROFS
from os.path import isfile, join, lexists
from shutil import rmtree
from stat import (
S_IRWXG,
S_IRWXO,
S_IRWXU,... | 165 | 4,687 |
conda | tests/gateways/disk/test_create.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from contextlib import nullcontext
import pytest
from conda.gateways.disk import create
@pytest.mark.parametrize(
"function,raises",
[
("create_application_entry_point", TypeError),
... | 25 | 699 |
conda | tests/gateways/disk/test_link.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
import os
from os.path import exists, isfile, join, lexists
from pathlib import Path
import pytest
from conda.common.compat import on_win
from conda.gateways.disk.link import islink, link, readlink, symlink
from conda.gateways.disk.test import... | 69 | 2,304 |
conda | tests/gateways/disk/test_delete.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import os
from errno import ENOENT
from os.path import isdir, isfile, join, lexists
from typing import TYPE_CHECKING
import pytest
from conda.common.compat import on_win
from conda.gateways.disk.create impor... | 210 | 6,295 |
conda | tests/gateways/disk/test_lock.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from pathlib import Path
import pytest
from pytest_mock import MockerFixture
from conda.common.compat import on_win
from conda.exceptions import LockError
from conda.gateways.disk.lock import _lock_impl
def test_LockError_raised(mocker: Mo... | 58 | 1,534 |
conda | tests/gateways/disk/test_read.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from pathlib import Path
from pprint import pprint
from conda.common.compat import on_win
from conda.common.path import get_python_site_packages_short_path
from conda.common.serialize import json
from conda.p... | 411 | 14,318 |
conda | tests/notices/test_core.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
import pytest
from conda.base.constants import NOTICES_DECORATOR_DISPLAY_INTERVAL
from conda.base.context import reset_context
from conda.notices import core as notices
from conda.testing.notices.helpers import (
DummyArgs,
add_resp_to_... | 188 | 5,361 |
conda | tests/notices/test_fetch.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from unittest.mock import patch
import requests
from conda.notices.cache import is_notice_response_cache_expired
from conda.notices.core import display_notices, retrieve_notices
from conda.testing.notices.helpers import add_resp_to_mock
def ... | 56 | 1,894 |
conda | tests/notices/test_deferred_imports.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Verify that importing conda.notices.core does not eagerly load heavy deps.
These tests run in a subprocess to get a clean sys.modules snapshot,
ensuring the deferred imports in notices/core.py are actually deferred.
"""
from __future__ impo... | 65 | 1,944 |
conda | tests/notices/test_types.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from conda.notices.types import UNDEFINED_MESSAGE_ID, ChannelNoticeResponse
from conda.testing.notices.helpers import get_test_notices
def test_channel_notice_response():
"""Tests a normal invocation of the ChannelNoticeResponse class."""... | 80 | 2,464 |
conda | tests/notices/test_cache.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from conda.notices import cache as notices_cache
from conda.notices import core as notices_core
if TYPE_CHECKING:
from pytest impo... | 96 | 2,967 |
conda | tests/shell/test_shell.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import os
from dataclasses import dataclass
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from conda.common.compat import on_linux, on_mac, on_win
from .. import TEST_RECIPES_CHANN... | 179 | 5,689 |
conda | tests/shell/__init__.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import os
import sys
from contextlib import contextmanager
from dataclasses import dataclass
from os.path import dirname
from shutil import which
from signal import SIGINT
from typing import TYPE_CHECKING, ove... | 330 | 12,333 |
conda | tests/shell/test_cmd_exe.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import os
import sys
from logging import getLogger
from pathlib import Path
from re import escape
from typing import TYPE_CHECKING
import pytest
from conda import CONDA_PACKAGE_ROOT
from conda import __versi... | 364 | 12,186 |
conda | tests/shell/test_fish.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from conda.activate import FishActivator
from conda.common.compat import on_win
if TYPE_CHECKING:
from . import Shell
pytestmark = [
pytest.mark.integ... | 74 | 2,241 |
conda | tests/shell/test_powershell.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import os
from logging import getLogger
from os.path import join
from typing import TYPE_CHECKING
import pytest
from conda import __version__ as CONDA_VERSION
from conda.common.compat import on_win
from . i... | 184 | 6,175 |
conda | tests/shell/test_xonsh.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from conda import __version__ as CONDA_VERSION
from conda.common.compat import on_win
if TYPE_CHECKING:
from . import Shell
pytestmark = [
pytest.mark... | 53 | 1,426 |
conda | tests/shell/test_posix.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import sys
from functools import cache
from logging import getLogger
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from conda import CONDA_PACKAGE_ROOT
from conda import __version__... | 362 | 13,133 |
conda | tests/shell/test_csh.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from conda import __version__ as CONDA_VERSION
from conda.common.compat import on_linux, on_win
if TYPE_CHECKING:
from . import Shell
pytestmark = [
p... | 62 | 1,855 |
conda | tests/shell/conftest.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from conda.common.compat import on_win
from . import Shell
if TYPE_CHECKING:
from collections.abc import Iterator
from pytest import FixtureRequest
... | 41 | 1,019 |
conda | tests/core/test_initialize.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import ntpath
import os
import sys
from collections import namedtuple
from contextlib import nullcontext
from os.path import abspath, dirname, isfile, join, realpath, samefile
from sysconfig import get_path
fr... | 1,553 | 53,470 |
conda | tests/core/test_subdir_data.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from logging import getLogger
from os.path import join
from pathlib import Path
from time import sleep
from typing import TYPE_CHECKING
import pytest
from conda import CondaError
from conda.base.context impo... | 447 | 15,304 |
conda | tests/core/test_solve.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import copy
import re
import sys
from importlib.metadata import version
from pprint import pprint
from typing import TYPE_CHECKING
from unittest.mock import Mock, patch
import archspec.cpu
import pytest
from... | 4,148 | 159,098 |
conda | tests/core/test_prefix_data.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import json
import shutil
import sys
from contextlib import nullcontext
from dataclasses import dataclass
from datetime import datetime, timezone
from pathlib import Path
from typing import TYPE_CHECKING
imp... | 1,219 | 40,933 |
conda | tests/core/test_portability.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
import os
import re
import subprocess
import pytest
from conda.auxlib.ish import dals
from conda.base.constants import PREFIX_PLACEHOLDER
from conda.common.compat import on_mac, on_win
from conda.core.portability import (
MAX_SHEBANG_LENGT... | 306 | 10,472 |
conda | tests/core/test_link.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
import pytest
from conda.core import link
from conda.core.link import UnlinkLinkTransaction
from conda.core.path_actions import RemoveLinkedPackageRecordAction
from conda.models.records import PackageRecord, PrefixRecord
def test_make_unlink... | 308 | 8,929 |
conda | tests/core/test_envs_manager.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import os
from logging import getLogger
from os.path import isdir, join
from types import SimpleNamespace
from typing import TYPE_CHECKING
from unittest.mock import patch
import pytest
from conda.auxlib.col... | 197 | 6,445 |
conda | tests/core/test_path_actions.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import importlib.util
import os
import sys
from logging import getLogger
from os.path import basename, dirname, getsize, isdir, isfile, join, lexists
from typing import TYPE_CHECKING
from uuid import uuid4
im... | 610 | 19,831 |
conda | tests/core/test_index.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import copy
from contextlib import nullcontext
from logging import getLogger
from typing import TYPE_CHECKING
import pytest
import conda
from conda.base.constants import DEFAULTS_CHANNEL_NAME
from conda.base... | 556 | 18,824 |
conda | tests/core/test_package_cache_data.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
import datetime
import json
from concurrent.futures import ThreadPoolExecutor
from os.path import abspath, basename, dirname, join
from pathlib import Path
from threading import Event
from types import SimpleNamespace
import pytest
from pytest ... | 781 | 28,101 |
conda | tests/_private/test_extract.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Verify the extraction worker module stays import-light."""
from __future__ import annotations
import subprocess
import sys
def test_extract_module_does_not_import_runtime_state() -> None:
script = """\
import sys
import conda._private... | 37 | 935 |
conda | tests/_private/test_exception_guidance.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import pytest
from conda import CondaError
from conda._private.exception_guidance import ErrorGuidance, GuidanceHint
def test_GuidanceHint() -> None:
hint = GuidanceHint("Do the thing.", "do_the_thing")... | 268 | 7,408 |
conda | tests/cli/test_find_commands.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import os
from typing import TYPE_CHECKING
import pytest
from conda.common.compat import on_win
with pytest.deprecated_call():
from conda.cli.find_commands import find_commands, find_executable
if TYPE... | 117 | 3,437 |
conda | tests/cli/test_main_list.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import json
import re
import sys
from typing import TYPE_CHECKING
import pytest
from conda.base.constants import CONDA_LIST_FIELDS
from conda.common.configuration import CustomValidationError
from conda.core... | 409 | 13,297 |
conda | tests/cli/test_main_config.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import json
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
import conda.exceptions
from conda.base.constants import SafetyChecks
from conda.base.context import context, reset_context... | 726 | 22,467 |
conda | tests/cli/test_main_rename.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import uuid
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from conda.base.context import (
context,
locate_prefix_by_name,
reset_context,
)
from conda.common.compat impo... | 358 | 10,644 |
conda | tests/cli/test_formats.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from conda.cli.formats import get_multiplatform_lockfile
from conda.plugins.types import CondaEnvironmentExporter, EnvironmentFormat
def test_get_multiplatform_lockfile():
# no plugins
assert get_multiplatform_lockfile({}) is None
... | 47 | 1,733 |
conda | tests/cli/test_all_commands.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
This testing module is for tests which test multiple commands under the same
circumstance.
"""
from __future__ import annotations
import re
import warnings
from argparse import ArgumentParser
from typing import TYPE_CHECKING
import pytest... | 127 | 3,785 |
conda | tests/cli/test_main_run.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import os
import stat
import subprocess
import uuid
from logging import WARNING, getLogger
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from conda.auxlib.ish import dals
from conda... | 516 | 16,209 |
conda | tests/cli/test_main_install.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from json import loads as json_loads
from typing import TYPE_CHECKING
import pytest
from conda.base.context import context, reset_context
from conda.common.compat import on_win
from conda.core.prefix_data im... | 212 | 7,344 |
conda | tests/cli/test_main_notices.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import datetime
import glob
import hashlib
import json
import os
from typing import TYPE_CHECKING
import pytest
from conda.base.constants import NOTICES_DECORATOR_DISPLAY_INTERVAL
from conda.base.context imp... | 463 | 14,118 |
conda | tests/cli/test_main_compare.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from conda.core.prefix_data import PrefixData
from conda.exceptions import EnvironmentLocationNotFound
if TYPE_CHECKING:
from pathlib import Path
from... | 43 | 1,210 |
conda | tests/cli/test_main_info.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import json
import re
from collections.abc import Iterable
from os.path import isdir
from pathlib import Path
from types import SimpleNamespace
from typing import TYPE_CHECKING
import pytest
from conda.base... | 368 | 10,806 |
conda | tests/cli/test_config.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import json
import re
import sys
from contextlib import contextmanager, nullcontext
from textwrap import dedent
from typing import TYPE_CHECKING
import pytest
from ruamel.yaml.scanner import ScannerError
fro... | 947 | 31,200 |
conda | tests/cli/test_main_create.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Tests for `conda create` help text."""
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from conda.cli.main_create import epilog as create_epilog
from conda.plugins import hookimpl
from conda.plugins.types... | 94 | 3,144 |
conda | tests/cli/test_conda_argparse.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import importlib
from inspect import isclass, isfunction
from logging import getLogger
from typing import TYPE_CHECKING
import pytest
from conda.cli.conda_argparse import (
ArgumentParser,
_GreedySub... | 160 | 6,491 |
conda | tests/cli/test_main_env_update.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from conda.exceptions import InvalidInstaller
from .test_main_env_create import DummyExternalPackagesEnvSpecPlugin
if TYPE_CHECKING:
from pathlib import P... | 32 | 991 |
conda | tests/cli/test_main_search.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import re
from typing import TYPE_CHECKING
import pytest
import requests
from conda.base.context import context, reset_context
from conda.cli.main_search import _pretty_record_format, pretty_record
from cond... | 503 | 14,107 |
conda | tests/cli/test_main_env_imports.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Verify that importing conda.cli.main_env does not eagerly load main_export."""
from __future__ import annotations
import subprocess
import sys
import textwrap
def test_main_env_does_not_eagerly_import_main_export() -> None:
"""main_en... | 29 | 895 |
conda | tests/cli/test_main_commands.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from typing import TYPE_CHECKING
from conda.base.context import context
from conda.cli.conda_argparse import BUILTIN_COMMANDS
if TYPE_CHECKING:
from conda.testing import CondaCLIFixture
def test_comman... | 25 | 646 |
conda | tests/cli/test_main_clean.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import json
from datetime import datetime, timezone
from logging import WARNING
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from conda.base.constants import (
CONDA_LOGS_DIR,
... | 431 | 12,490 |
conda | tests/cli/test_main_update.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from conda.exceptions import CondaUpdatePackageError
from conda.testing.integration import package_is_installed
if TYPE_CHECKING:
from pathlib import Path
... | 52 | 1,482 |
conda | tests/cli/test_main_env_create.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from conda.base.context import context
from conda.cli.main_env_create import epilog as env_create_epilog
from conda.exceptions import InvalidInstaller
from cond... | 110 | 3,888 |
conda | tests/cli/test_cli_install.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from argparse import Namespace
from typing import TYPE_CHECKING
import pytest
from conda.base.context import context, reset_context
from conda.cli.install import reinstall_packages
from conda.core.prefix_dat... | 269 | 8,265 |
conda | tests/cli/test_main_export.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Test conda export."""
from __future__ import annotations
import json
import uuid
import warnings
from typing import TYPE_CHECKING
import pytest
from conda.base.context import context
from conda.cli.main_export import CondaExportWarning
fr... | 1,090 | 38,392 |
conda | tests/cli/test_common.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
import os
from pathlib import Path
import pytest
from pytest import MonkeyPatch, raises
from pytest_mock import MockerFixture
from conda.base.context import context, reset_context
from conda.cli.common import (
check_non_admin,
get_nam... | 292 | 8,675 |
conda | tests/cli/test_main.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from conda.base.context import context
from conda.cli.main import main, main_sourced, main_subshell
from conda.common.compat import on_win
if TYPE_CHECKING:
... | 157 | 4,774 |
conda | tests/cli/test_helpers.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Tests for conda.cli.helpers module."""
from __future__ import annotations
import argparse
from argparse import ArgumentParser, Namespace
import pytest
from conda.cli.helpers import LazyChoicesAction
@pytest.fixture
def simple_choices():... | 372 | 11,044 |
conda | tests/cli/test_env.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import json
import re
from pathlib import Path
from typing import TYPE_CHECKING
from uuid import uuid4
import pytest
from conda.base.constants import PREFIX_MAGIC_FILE
from conda.base.context import context
... | 762 | 23,911 |
conda | tests/cli/test_compare.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from typing import TYPE_CHECKING
from conda.auxlib.ish import dals
if TYPE_CHECKING:
from pathlib import Path
from conda.testing.fixtures import CondaCLIFixture, TmpEnvFixture
def test_compare_suc... | 59 | 1,474 |
conda | tests/cli/test_main_remove.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import json
from importlib.metadata import version
from logging import getLogger
from typing import TYPE_CHECKING
import pytest
from conda.base.context import context, reset_context
from conda.common.io impo... | 170 | 5,362 |
conda | tests/cli/test_startup_benchmarks.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Startup performance benchmarks.
Measures the cost of conda's startup phases. Runs locally with
``pytest -m benchmark tests/cli/test_startup_benchmarks.py``.
Import benchmarks use ``benchmark.pedantic`` with a setup function that
scrubs cach... | 260 | 8,171 |
conda | tests/cli/test_subcommands.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import json
from typing import TYPE_CHECKING
import pytest
from conda.common.compat import on_win
if TYPE_CHECKING:
from pathlib import Path
from pytest_benchmark.fixture import BenchmarkFixture
... | 340 | 8,669 |
conda | tests/cli/test_actions.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from argparse import ArgumentParser
from contextlib import nullcontext
from typing import TYPE_CHECKING
import pytest
from conda.cli import actions
from conda.cli.actions import NullCountAction
from conda.co... | 46 | 1,325 |
conda | tests/cli/conftest.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
import logging
import pytest
@pytest.fixture(autouse=True)
def urllib3_logger_error(caplog):
"""Increase log level to error to prevent retries from polluting stderr."""
caplog.set_level(logging.ERROR, logger="urllib3.connectionpool")
| 12 | 320 |
conda | tests/shards/test_shards.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
Test sharded repodata.
"""
from __future__ import annotations
import hashlib
import json
import logging
import os
import sqlite3
import tempfile
import threading
import time
import warnings
from pathlib import Path
from typing import TYPE_... | 1,655 | 54,534 |
conda | tests/shards/test_shards_subset.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import concurrent.futures
import json
import queue
import random
import threading
import time
import urllib.parse
from contextlib import suppress
from pathlib import Path
from queue import Empty, SimpleQueue
f... | 1,350 | 45,258 |
conda | tests/shards/__init__.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
Sharded repodata tests
"""
| 6 | 106 |
conda | tests/shards/test_shardfetch.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
Tests for "ShardFetch". This code is part of the "bfs" algorithm, which helps to
provide an important baseline and comparison but is not executed during the
default "pipelined" shard traversal.
"""
from __future__ import annotations
import... | 180 | 6,383 |
conda | tests/shards/test_coverage.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
Fast, mostly AI-generated tests to help reach 100% coverage of conda shards
modules.
Tests focus on uncovered code paths in:
- misc.py: URL handling, threading, exception handling
- cache.py: Database operations, WAL mode, error recovery
- ... | 995 | 36,850 |
conda | tests/shards/http_server.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
Custom HTTP server utilities for serving sharded repodata in tests.
"""
from __future__ import annotations
import contextlib
import http.server
import queue
import socket
import threading
from pathlib import Path
from typing import TYPE_CH... | 112 | 3,635 |
conda | tests/shards/test_cache.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Tests for cache functionality with concurrent access and WAL mode."""
from __future__ import annotations
import platform
import threading
import pytest
from conda._private import zstd
from conda._private.shards.cache import AnnotatedRawSh... | 123 | 4,459 |
conda | tests/shards/conftest.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
Sharded repodata test fixtures and utilities.
Adapted from conda-libmamba-solver/tests
"""
from __future__ import annotations
import contextlib
import hashlib
import http.server
import logging
import queue
import socket
import tempfile
im... | 435 | 13,264 |
conda | tests/common/test_configuration.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from os import environ
from os.path import expandvars
from pathlib import Path
from types import SimpleNamespace
from uuid import uuid4
import pytest
from pytest import MonkeyPatch, raises
from conda.auxlib.ish import dals
from conda.common.co... | 1,050 | 30,268 |
conda | tests/common/test_yaml_deferred_imports.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Verify that importing conda.common.serialize.yaml does not eagerly load ruamel.yaml."""
from __future__ import annotations
import subprocess
import sys
import textwrap
import pytest
from conda.common.serialize import yaml
def test_yaml_... | 82 | 2,469 |
conda | tests/common/test_serialize.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from contextlib import nullcontext
from functools import partial
from io import StringIO
from typing import TYPE_CHECKING
import pytest
from conda.base.constants import SafetyChecks
from conda.common import ... | 219 | 3,938 |
conda | tests/common/test_io.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import sys
import time
from concurrent.futures import ThreadPoolExecutor
from contextlib import nullcontext
from io import StringIO
from logging import DEBUG, NOTSET, WARNING, getLogger
import pytest
from co... | 183 | 5,318 |
conda | tests/common/test_url.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from logging import getLogger
from typing import NamedTuple
import pytest
from conda.common.url import (
Url,
add_username_and_password,
is_ip_address,
is_ipv6_address,
is_url,
maybe_... | 164 | 5,121 |
conda | tests/common/test_terminal.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import pytest
from conda.common.terminal import (
force_color,
no_color,
should_use_color,
term_dumb,
)
@pytest.mark.parametrize(
"term,expected",
[("dumb", True), ("unknown", True),... | 91 | 2,688 |
conda | tests/common/test_path.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import ntpath
import re
from contextlib import nullcontext
from logging import getLogger
from pathlib import PureWindowsPath
from typing import TYPE_CHECKING
import pytest
from conda.base.context import con... | 465 | 19,050 |
conda | tests/common/test_json.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Tests for conda.common.serialize.json module."""
from __future__ import annotations
import json
from frozendict import frozendict
from conda.common.serialize.json import CondaJSONEncoder, dumps
def test_condajsonencoder_serialises_froze... | 39 | 1,096 |
conda | tests/common/test_io_deferred_imports.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Verify that importing conda.common.io does not eagerly load concurrency modules."""
from __future__ import annotations
import subprocess
import sys
import textwrap
def test_io_does_not_eagerly_import_concurrent_futures() -> None:
"""c... | 51 | 1,622 |
conda | tests/common/test_logic.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from itertools import chain, combinations, permutations, product
import pytest
from conda.common.logic import FALSE, TRUE, Clauses, minimal_unsatisfiable_subset
from conda.testing.helpers import raises
# These routines implement logical tests... | 422 | 13,074 |
conda | tests/common/test_toposort.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
import pytest
from conda.common.toposort import pop_key, toposort
def test_pop_key():
key = pop_key({"a": {"b", "c"}, "b": {"c"}})
assert key == "b"
key = pop_key({"a": {"b"}, "b": {"c", "a"}})
assert key == "a"
key = po... | 99 | 2,816 |
conda | tests/common/_os/test_windows.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from conda.common._os.windows import is_admin_on_windows
from conda.common.compat import on_win
def test_is_admin_on_windows():
result = is_admin_on_windows()
if on_win:
assert result is False or result is True
else:
... | 13 | 345 |
conda | tests/common/pkg_formats/test_python.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Test for python distribution information and metadata handling."""
import os
import tempfile
from errno import ENOENT
from os.path import basename
from pathlib import Path
from pprint import pprint
import pytest
from conda.common.path impo... | 722 | 24,876 |
conda | tests/common/path/test_windows.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from conda.base.context import context
from conda.common.compat import on_win
from conda.common.path.windows import unix_path_to_win, win_path_to_unix
if TYPE_... | 297 | 8,637 |
conda | tests/common/path/test_python.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import pytest
from conda.common.path.python import is_valid_import_path
@pytest.mark.parametrize(
"path,result",
[
("python", True),
("python.path", True),
("python._path0123... | 40 | 1,084 |
conda | tests/data/build-index4-json.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
import json
from os.path import abspath, dirname, join
from pprint import pprint
from conda.core.subdir_data import SubdirData
DATA_DIR = abspath(join(dirname(__file__), "repodata"))
def save_data_source(url, name):
raw_repodata_str = Su... | 884 | 23,511 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.