tests packageΒΆ

SubmodulesΒΆ

tests.test_architecture_data moduleΒΆ

Test all architecture definitions, detection and architecture-specific groups.

tests.test_architecture_data.test_architecture_data_sorting()[source]ΒΆ

Architecture instances must be sorted alphabetically.

tests.test_architecture_data.test_architecture_detection()[source]ΒΆ
tests.test_architecture_data.test_architecture_logical_grouping()[source]ΒΆ
tests.test_architecture_data.test_no_missing_architecture_in_groups()[source]ΒΆ

Check all architecture are attached to at least one non-overlapping group.

tests.test_ci_data moduleΒΆ

Test all CI definitions, detection and CI-specific groups.

tests.test_ci_data.github_runner_os()[source]ΒΆ

Returns the OS name as defined in the GitHub Actions matrix context.

Caution

This only works when running inside a GitHub Actions job that uses a matrix strategy with an os variant. Which is the case for the extra-platforms workflows.

Return type:

str | None

tests.test_ci_data.test_ci_data_sorting()[source]ΒΆ

CI instances must be sorted alphabetically.

tests.test_ci_data.test_github_runner_detection()[source]ΒΆ

Test GitHub runner OS.

List of available GitHub runner images: https://github.com/actions/runner-images#available-images

tests.test_ci_data.test_ci_detection()[source]ΒΆ
tests.test_ci_data.test_ci_logical_grouping()[source]ΒΆ
tests.test_ci_data.test_no_missing_ci_in_groups()[source]ΒΆ

Check all CI are attached to at least one non-overlapping group.

tests.test_detection moduleΒΆ

tests.test_detection.test_detection_trait_functions(obj)[source]ΒΆ
tests.test_detection.test_detection_heuristics_sorting()[source]ΒΆ

Detection heuristics must be sorted within each section.

tests.test_detection.test_is_arm_depends_on_arm_variants()[source]ΒΆ

Test that is_arm() correctly calls ARM variant detection functions.

tests.test_detection.test_detection_functions_cached()[source]ΒΆ

Test that detection functions are cached with @cache decorator.

tests.test_detection.test_environment_variable_ci_detection(monkeypatch)[source]ΒΆ

Test CI detection based on environment variables.

tests.test_detection.test_detection_no_circular_dependencies()[source]ΒΆ

Test that detection functions can all be called without circular dependency issues.

tests.test_group moduleΒΆ

tests.test_group.test_deduplication()[source]ΒΆ
tests.test_group.test_membership()[source]ΒΆ
tests.test_group.test_extract_members(items, expected)[source]ΒΆ
tests.test_group.test_extract_members_bad_type(item)[source]ΒΆ
tests.test_group.test_canonical_property()[source]ΒΆ
tests.test_group.test_simple_union()[source]ΒΆ
tests.test_group.test_multiple_union()[source]ΒΆ
tests.test_group.test_single_intersection()[source]ΒΆ
tests.test_group.test_multiple_intersection()[source]ΒΆ
tests.test_group.test_single_difference()[source]ΒΆ
tests.test_group.test_multiple_difference()[source]ΒΆ
tests.test_group.test_symmetric_difference()[source]ΒΆ
tests.test_group.test_copy()[source]ΒΆ
tests.test_group.test_bool()[source]ΒΆ

Test __bool__() method for truth value testing.

tests.test_group.test_add()[source]ΒΆ

Test add() method for adding a single trait.

tests.test_group.test_remove()[source]ΒΆ

Test remove() method for removing a trait with error checking.

tests.test_group.test_discard()[source]ΒΆ

Test discard() method for removing a trait without error.

tests.test_group.test_pop()[source]ΒΆ

Test pop() method for removing and returning a trait.

tests.test_group.test_clear()[source]ΒΆ

Test clear() method for emptying a group.

tests.test_group.test_in_place_operators()[source]ΒΆ

Test in-place operators that return new instances.

tests.test_group.test_set_operations_with_new_methods()[source]ΒΆ

Test combining new methods with existing set operations.

tests.test_group.test_extract_members_with_unsupported_type()[source]ΒΆ

Test that extract_members raises TypeError for unsupported types.

tests.test_group.test_getitem_with_missing_key()[source]ΒΆ

Test that __getitem__ raises KeyError with proper message.

tests.test_group.test_empty_group_bool()[source]ΒΆ

Test that empty groups evaluate to False.

tests.test_group.test_group_operations_with_empty_groups()[source]ΒΆ

Test group operations with empty groups.

tests.test_group.test_group_with_duplicate_members()[source]ΒΆ

Test that duplicate members in constructor are deduplicated.

tests.test_group.test_group_contains_with_string()[source]ΒΆ

Test Group.__contains__ with string IDs.

tests.test_group.test_group_contains_with_wrong_trait_object()[source]ΒΆ

Test that Group.__contains__ checks object identity, not just ID.

tests.test_group.test_group_items()[source]ΒΆ

Test Group.items() returns key-value pairs.

tests.test_group.test_group_extract_members_with_none()[source]ΒΆ

Test that extract_members ignores None values.

tests.test_group.test_group_extract_members_nested()[source]ΒΆ

Test that extract_members handles nested structures.

tests.test_group.test_group_fullyintersects()[source]ΒΆ

Test fullyintersects method.

tests.test_group.test_group_canonical_property()[source]ΒΆ

Test that Group.canonical property works correctly.

tests.test_group.test_unique_ids()[source]ΒΆ

Traits and group IDs must be unique.

tests.test_group.randomize_case(strings)[source]ΒΆ

Generate variations of strings with different case.

Return type:

set[str]

tests.test_group.test_traits_from_ids(trait_id)[source]ΒΆ

Test traits_from_ids with various case variations.

tests.test_group.test_traits_from_ids_group_resolve(group_id)[source]ΒΆ

traits_from_ids() can also resolve group IDs.

tests.test_group.test_groups_from_ids(group_id)[source]ΒΆ

Test groups_from_ids with various case variations.

tests.test_group.test_reduction(items, expected)[source]ΒΆ

Test reduce function with various inputs.

tests.test_group.test_reduce_custom_targets(items, expected)[source]ΒΆ

Test reduce with custom target pool.

tests.test_group.test_traits_from_ids_with_invalid_id()[source]ΒΆ

Test that traits_from_ids raises ValueError for invalid IDs.

tests.test_group.test_groups_from_ids_with_invalid_id()[source]ΒΆ

Test that groups_from_ids raises ValueError for invalid IDs.

tests.test_group.test_traits_from_ids_with_empty_list()[source]ΒΆ

Test that traits_from_ids works with empty input.

tests.test_group.test_groups_from_ids_with_empty_list()[source]ΒΆ

Test that groups_from_ids works with empty input.

tests.test_group.test_traits_from_ids_with_multiple_valid_ids()[source]ΒΆ

Test that traits_from_ids works with multiple valid IDs.

tests.test_group.test_groups_from_ids_with_multiple_valid_ids()[source]ΒΆ

Test that groups_from_ids works with multiple valid IDs.

tests.test_group.test_reduce_with_already_minimal_group()[source]ΒΆ

Test reduce with groups that cannot be further reduced.

tests.test_group.test_reduce_with_complex_overlap()[source]ΒΆ

Test reduce with complex overlapping groups.

tests.test_group.test_reduce_returns_frozenset()[source]ΒΆ

Test that reduce always returns a frozenset.

tests.test_group.test_all_ids_constant()[source]ΒΆ

Test that ALL_IDS constant contains all trait and group IDs.

tests.test_group.test_all_trait_ids_completeness()[source]ΒΆ

Test that ALL_TRAIT_IDS contains IDs from all non-unknown traits.

tests.test_group.test_all_group_ids_completeness()[source]ΒΆ

Test that ALL_GROUP_IDS contains IDs from all non-unknown groups.

tests.test_group_data moduleΒΆ

tests.test_group_data.test_group_class_metadata()[source]ΒΆ
tests.test_group_data.test_group_data_ordering()[source]ΒΆ

Group instances follow logical order, not alphabetical.

tests.test_group_data.test_group_definitions(group)[source]ΒΆ
tests.test_group_data.test_unique_icons()[source]ΒΆ

Check all group icons are unique.

tests.test_group_data.test_unknown_group()[source]ΒΆ

All members of the UNKNOWN group are unknown traits.

tests.test_group_data.test_sets_of_groups()[source]ΒΆ

Test properties of sets of groups, as well as individual groups.

tests.test_group_data.test_non_overlapping_groups()[source]ΒΆ

Check non-overlapping groups are mutually exclusive.

tests.test_group_data.test_overlapping_groups()[source]ΒΆ

Check all extra groups overlaps with at least one non-overlapping.

tests.test_group_data.test_each_trait_in_exactly_one_canonical_group()[source]ΒΆ

Check each trait belongs to exactly one canonical group.

tests.test_group_data.test_canonical_groups_dont_overlap()[source]ΒΆ

Test that canonical groups have no members in common with each other.

tests.test_group_data.test_canonical_groups_cover_all_traits()[source]ΒΆ

Test that canonical groups together cover all recognized traits.

tests.test_group_data.test_non_overlapping_groups_completeness()[source]ΒΆ

Test that NON_OVERLAPPING_GROUPS is properly defined.

tests.test_group_data.test_canonical_group_marker()[source]ΒΆ

Test that canonical groups have the β¬₯ marker in their documentation.

tests.test_platform_data moduleΒΆ

Test all platform definitions and platform-specific groups.

tests.test_platform_data.test_platform_data_sorting()[source]ΒΆ

Platform instances must be sorted alphabetically.

tests.test_platform_data.test_platform_detection()[source]ΒΆ
tests.test_platform_data.test_platform_logical_grouping()[source]ΒΆ
tests.test_platform_data.test_no_missing_platform_in_groups()[source]ΒΆ

Check all platform are attached to at least one non-overlapping group.

tests.test_pytest moduleΒΆ

tests.test_pytest.test_all_definition()[source]ΒΆ
tests.test_pytest.test_type_annotations()[source]ΒΆ

Check all @skip_*/@unless_* annotations are defined and sorted.

tests.test_pytest.test_skip_unknown()[source]ΒΆ
tests.test_pytest.test_unless_unknown()[source]ΒΆ
tests.test_pytest.test_skip_all_architectures()[source]ΒΆ
tests.test_pytest.test_unless_any_architecture()[source]ΒΆ
tests.test_pytest.test_skip_all_platforms()[source]ΒΆ
tests.test_pytest.test_unless_any_platform()[source]ΒΆ
tests.test_pytest.test_skip_all_shells()[source]ΒΆ
tests.test_pytest.test_unless_any_shell()[source]ΒΆ
tests.test_pytest.test_skip_all_ci()[source]ΒΆ
tests.test_pytest.test_unless_any_ci()[source]ΒΆ
tests.test_pytest.test_skip_unknown_architecture()[source]ΒΆ
tests.test_pytest.test_unless_unknown_architecture()[source]ΒΆ
tests.test_pytest.test_skip_unknown_platform()[source]ΒΆ
tests.test_pytest.test_unless_unknown_platform()[source]ΒΆ
tests.test_pytest.test_skip_unknown_shell()[source]ΒΆ
tests.test_pytest.test_unless_unknown_shell()[source]ΒΆ
tests.test_pytest.test_skip_unknown_ci()[source]ΒΆ
tests.test_pytest.test_unless_unknown_ci()[source]ΒΆ
tests.test_pytest.test_skip_aarch64()[source]ΒΆ
tests.test_pytest.test_unless_aarch64()[source]ΒΆ
tests.test_pytest.test_skip_x86_64()[source]ΒΆ
tests.test_pytest.test_unless_x86_64()[source]ΒΆ
tests.test_pytest.test_skip_linux()[source]ΒΆ
tests.test_pytest.test_unless_linux()[source]ΒΆ
tests.test_pytest.test_skip_macos()[source]ΒΆ
tests.test_pytest.test_unless_macos()[source]ΒΆ
tests.test_pytest.test_skip_ubuntu()[source]ΒΆ
tests.test_pytest.test_unless_ubuntu()[source]ΒΆ
tests.test_pytest.test_skip_windows()[source]ΒΆ
tests.test_pytest.test_unless_windows()[source]ΒΆ
tests.test_pytest.test_skip_bash()[source]ΒΆ
tests.test_pytest.test_unless_bash()[source]ΒΆ
tests.test_pytest.test_skip_powershell()[source]ΒΆ
tests.test_pytest.test_unless_powershell()[source]ΒΆ
tests.test_pytest.test_skip_github_ci()[source]ΒΆ
tests.test_pytest.test_unless_github_ci()[source]ΒΆ
tests.test_pytest.test_deferred_condition_defers_evaluation()[source]ΒΆ

Test that _DeferredCondition defers evaluation until needed.

tests.test_pytest.test_deferred_condition_bool()[source]ΒΆ

Test that _DeferredCondition.__bool__() calls the condition.

tests.test_pytest.test_deferred_condition_call()[source]ΒΆ

Test that _DeferredCondition.__call__() works.

tests.test_pytest.test_deferred_condition_invert_false()[source]ΒΆ

Test that _DeferredCondition with invert=False returns the condition result.

tests.test_pytest.test_deferred_condition_invert_true()[source]ΒΆ

Test that _DeferredCondition with invert=True inverts the condition result.

tests.test_pytest.test_deferred_condition_with_pytest_skipif()[source]ΒΆ

Test that _DeferredCondition works with pytest.mark.skipif.

tests.test_root moduleΒΆ

tests.test_root.PROJECT_ROOT = PosixPath('/home/runner/work/extra-platforms/extra-platforms')ΒΆ

The root path of the project.

tests.test_root.PYPROJECT_PATH = PosixPath('/home/runner/work/extra-platforms/extra-platforms/pyproject.toml')ΒΆ

The path to the pyproject.toml file.

tests.test_root.PYPROJECT = {'build-system': {'build-backend': 'uv_build', 'requires': ['uv-build>=0.9']}, 'dependency-groups': {'docs': ['click-extra[sphinx]>=7.5', 'furo>=2025.9.25', 'myst-parser>=5', 'pytest>=8.2.1', 'sphinx>=9.1', 'sphinx-autodoc-typehints>=2.4', 'sphinx-copybutton>=0.5.2', 'sphinx-design>=0.6', 'sphinx-issues>=5', 'sphinxcontrib-mermaid>=1.2.2', 'sphinxext-opengraph>=0.13', 'wcmatch>=10'], 'test': ['coverage[toml]>=7.11', 'pytest', 'pytest-cov>=7', 'pytest-github-actions-annotate-failures>=0.3', 'pytest-randomly>=4', 'pytest-xdist[psutil]>=3.7', 'requests>=2.32.5', "tomli>=2.3; python_version<'3.11'"], 'typing': ['types-requests>=2.32.4.20250611']}, 'project': {'authors': [{'email': 'kevin@deldycke.com', 'name': 'Kevin Deldycke'}], 'classifiers': ['Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Environment :: MacOS X', 'Environment :: WebAssembly', 'Environment :: WebAssembly :: Emscripten', 'Environment :: WebAssembly :: WASI', 'Environment :: Win32 (MS Windows)', 'Framework :: Pytest', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)', 'Operating System :: Android', 'Operating System :: BeOS', 'Operating System :: iOS', 'Operating System :: MacOS', 'Operating System :: MacOS :: MacOS 9', 'Operating System :: MacOS :: MacOS X', 'Operating System :: Microsoft', 'Operating System :: Microsoft :: MS-DOS', 'Operating System :: Microsoft :: Windows', 'Operating System :: Microsoft :: Windows :: Windows 3.1 or Earlier', 'Operating System :: Microsoft :: Windows :: Windows 7', 'Operating System :: Microsoft :: Windows :: Windows 8', 'Operating System :: Microsoft :: Windows :: Windows 8.1', 'Operating System :: Microsoft :: Windows :: Windows 10', 'Operating System :: Microsoft :: Windows :: Windows 11', 'Operating System :: Microsoft :: Windows :: Windows 95/98/2000', 'Operating System :: Microsoft :: Windows :: Windows CE', 'Operating System :: Microsoft :: Windows :: Windows NT/2000', 'Operating System :: Microsoft :: Windows :: Windows Server 2003', 'Operating System :: Microsoft :: Windows :: Windows Server 2008', 'Operating System :: Microsoft :: Windows :: Windows Vista', 'Operating System :: Microsoft :: Windows :: Windows XP', 'Operating System :: OS Independent', 'Operating System :: OS/2', 'Operating System :: Other OS', 'Operating System :: PalmOS', 'Operating System :: PDA Systems', 'Operating System :: POSIX', 'Operating System :: POSIX :: AIX', 'Operating System :: POSIX :: BSD', 'Operating System :: POSIX :: BSD :: BSD/OS', 'Operating System :: POSIX :: BSD :: FreeBSD', 'Operating System :: POSIX :: BSD :: NetBSD', 'Operating System :: POSIX :: BSD :: OpenBSD', 'Operating System :: POSIX :: GNU Hurd', 'Operating System :: POSIX :: HP-UX', 'Operating System :: POSIX :: IRIX', 'Operating System :: POSIX :: Linux', 'Operating System :: POSIX :: Other', 'Operating System :: POSIX :: SCO', 'Operating System :: POSIX :: SunOS/Solaris', 'Operating System :: RISC OS', 'Operating System :: Unix', 'Programming Language :: Python :: 3 :: Only', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: 3.13', 'Programming Language :: Python :: 3.14', 'Programming Language :: Python :: Implementation :: CPython', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: System :: Hardware', 'Topic :: System :: Operating System', 'Topic :: System :: Operating System Kernels', 'Topic :: System :: Operating System Kernels :: BSD', 'Topic :: System :: Operating System Kernels :: GNU Hurd', 'Topic :: System :: Operating System Kernels :: Linux', 'Topic :: Utilities', 'Typing :: Typed'], 'dependencies': ['distro>=1.9'], 'description': 'πŸ”Ž Detect architectures, platforms, shells, terminals and CI systems, grouped by family', 'entry-points': {'pytest11': {'extra-platforms': 'extra_platforms.pytest'}}, 'keywords': ['Alacritty', 'Almquist Shell', 'Alpine Linux', 'ALT Linux', 'Amazon Linux', 'Android', 'Apple Terminal', 'Arch Linux', 'Architecture detection', 'ARM (32-bit)', 'ARM64 (AArch64)', 'ARMv5TE (little-endian)', 'ARMv6 (little-endian)', 'ARMv7 (little-endian)', 'ARMv8 (32-bit, little-endian)', 'AT&T System Five', 'Azure Pipelines', 'Bamboo', 'Bash', 'Buildkite', 'Buildroot', 'C shell', 'CachyOS', 'CentOS', 'Circle CI', 'Cirrus CI', 'CloudLinux OS', 'CodeBuild', 'Command Prompt', 'Contour', 'Cygwin', 'Dash', 'Debian', 'DragonFly BSD', 'Exherbo Linux', 'Fedora', 'Fish', 'foot', 'FreeBSD', 'Gentoo Linux', 'Ghostty', 'GitHub Actions runner', 'GitLab CI', 'GNOME Terminal', 'GNU Screen', 'GNU/Hurd', 'Guix System', 'Haiku', 'Heroku CI', 'Hyper', 'IBM AIX', 'IBM PowerKVM', 'IBM z/Architecture (s390x)', 'illumos', 'Intel 80386 (i386)', 'Intel Pentium (i586)', 'Intel Pentium Pro (i686)', 'iTerm2', 'Kali Linux', 'Kitty', 'Konsole', 'Korn shell', 'KVM for IBM z Systems', 'Linux Mint', 'LoongArch (64-bit)', 'macOS', 'Mageia', 'Mandriva Linux', 'Manjaro Linux', 'MidnightBSD', 'MIPS (32-bit, big-endian)', 'MIPS (32-bit, little-endian)', 'MIPS64 (big-endian)', 'MIPS64 (little-endian)', 'multiplatform', 'NetBSD', 'Nobara', 'Nushell', 'OpenBSD', 'openSUSE', 'OpenWrt', 'Oracle Linux', 'OS detection', 'Parallels', 'Pidora', 'Platform detection', 'PowerPC (32-bit)', 'PowerPC 64-bit (big-endian)', 'PowerPC 64-bit (little-endian)', 'PowerShell', 'Pytest', 'Raspbian', 'RedHat Enterprise Linux', 'Rio', 'RISC-V (32-bit)', 'RISC-V (64-bit)', 'Rocky Linux', 'Scientific Linux', 'Slackware', 'Solaris', 'SPARC (32-bit)', 'SPARC (64-bit)', 'SunOS', 'SUSE Linux Enterprise Server', 'Tabby', 'tcsh', 'TeamCity', 'Tilix', 'tmux', 'Travis CI', 'Tuxedo OS', 'Ubuntu', 'Ultramarine', 'Unix', 'VS Code Terminal', 'WebAssembly (32-bit)', 'WebAssembly (64-bit)', 'WezTerm', 'Windows', 'Windows Subsystem for Linux', 'Windows Terminal', 'x86-64 (AMD64)', 'XenServer', 'Xonsh', 'xterm', 'Zellij', 'Zsh'], 'license-files': ['license'], 'name': 'extra-platforms', 'optional-dependencies': {'pytest': ['pytest>=8.2.1']}, 'readme': 'readme.md', 'requires-python': '>=3.10', 'scripts': {'extra-platforms': 'extra_platforms.__main__:main'}, 'urls': {'Changelog': 'https://github.com/kdeldycke/extra-platforms/blob/main/changelog.md', 'Documentation': 'https://kdeldycke.github.io/extra-platforms', 'Download': 'https://github.com/kdeldycke/extra-platforms/releases/tag/v9.2.1.dev0', 'Funding': 'https://github.com/sponsors/kdeldycke', 'Homepage': 'https://github.com/kdeldycke/extra-platforms', 'Issues': 'https://github.com/kdeldycke/extra-platforms/issues', 'Repository': 'https://github.com/kdeldycke/extra-platforms'}, 'version': '9.2.1.dev0'}, 'tool': {'bumpversion': {'allow_dirty': True, 'current_version': '9.2.1.dev0', 'files': [{'glob': './**/__init__.py', 'ignore_missing_version': True}, {'filename': './pyproject.toml', 'replace': 'version = "{new_version}"', 'search': 'version = "{current_version}"'}, {'filename': './pyproject.toml', 'replace': 'releases/tag/v{new_version}', 'search': 'releases/tag/v{current_version}'}, {'filename': './changelog.md', 'replace': '## [{new_version} (unreleased)](', 'search': '## [{current_version} (unreleased)]('}, {'filename': './citation.cff', 'replace': 'version: {new_version}', 'search': 'version: {current_version}'}, {'filename': './citation.cff', 'regex': True, 'replace': 'date-released: {utcnow:%Y-%m-%d}', 'search': 'date-released: \\d{{4}}-\\d{{2}}-\\d{{2}}'}], 'parse': '(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(\\.dev(?P<dev>\\d+))?', 'parts': {'dev': {'optional_value': 'release', 'values': ['0', 'release']}}, 'serialize': ['{major}.{minor}.{patch}.dev{dev}', '{major}.{minor}.{patch}']}, 'coverage': {'report': {'precision': 2}, 'run': {'branch': True, 'source': ['extra_platforms']}}, 'gha-utils': {'nuitka': False}, 'mypy': {'pretty': True, 'warn_redundant_casts': True, 'warn_return_any': True, 'warn_unreachable': True, 'warn_unused_configs': True, 'warn_unused_ignores': True}, 'pytest': {'ini_options': {'addopts': ['--durations=10', '--cov-report=term', '--cov-report=xml', '--junitxml=junit.xml', '--override-ini=junit_family=legacy'], 'xfail_strict': True}}, 'ruff': {'extend-include': ['*.{markdown,mdown,mkdn,mdwn,mkd,md,mdtxt,mdtext,mdx}'], 'fix': True, 'format': {'docstring-code-format': True}, 'lint': {'future-annotations': True, 'ignore': ['D400', 'ERA001']}, 'preview': True, 'show-fixes': True, 'unsafe-fixes': True}, 'typos': {'default': {'extend-ignore-identifiers-re': ['Tru64', 'PASE', 'Sur', 'certifi']}}, 'uv': {'build-backend': {'module-root': ''}, 'dependency-groups': {'docs': {'requires-python': '>= 3.12'}}, 'exclude-newer': '2026-02-09T00:00:00Z'}}}ΒΆ

The parsed content of the pyproject.toml file.

tests.test_root.test_pyproject_keywords()[source]ΒΆ

Check that keywords in pyproject.toml are correct.

tests.test_root.test_pyproject_classifiers()[source]ΒΆ

Check that Trove classifiers in pyproject.toml are correct.

tests.test_root.test_module_root_declarations()[source]ΒΆ
tests.test_root.test_current_funcs()[source]ΒΆ
tests.test_root.test_current_strict_mode(current_func, all_collection, unknown_constant, trait_type, error_message, monkeypatch)[source]ΒΆ

Test that current_*(strict=True) raises an error when unrecognized.

tests.test_root.test_group_membership_funcs()[source]ΒΆ
tests.test_root.test_invalidate_caches()[source]ΒΆ

Test that invalidate_caches() properly clears all caches.

tests.test_root.test_multiple_architectures_match(monkeypatch)[source]ΒΆ

Test RuntimeError when multiple architectures match.

tests.test_root.test_multiple_platforms_match_non_wsl(monkeypatch)[source]ΒΆ

Test RuntimeError when multiple non-WSL platforms match.

tests.test_root.test_multiple_shells_match(monkeypatch)[source]ΒΆ

Test RuntimeError when multiple shells match.

tests.test_root.test_multiple_ci_systems_match(monkeypatch)[source]ΒΆ

Test RuntimeError when multiple CI systems match.

tests.test_root.test_unrecognized_message_format()[source]ΒΆ

Test that _unrecognized_message contains expected fields.

tests.test_root.test_invalidate_caches_python_314(monkeypatch)[source]ΒΆ

Test that invalidate_caches calls platform.invalidate_caches on Python 3.14+.

tests.test_root.test_invalidate_caches_clears_all_detection_functions()[source]ΒΆ

Test that invalidate_caches clears all detection function caches.

tests.test_root.test_invalidate_caches_clears_group_detection_functions()[source]ΒΆ

Test that invalidate_caches clears dynamically generated group detection functions.

tests.test_root.test_invalidate_caches_clears_trait_current_property()[source]ΒΆ

Test that invalidate_caches clears Trait.current cached_property.

tests.test_sphinx_crossrefs moduleΒΆ

Tests for Sphinx cross-reference rendering in the real documentation.

These tests verify that cross-references in the built documentation (./docs/html/) resolve to actual links with correct href attributes. Unlike mock-based tests, these catch real regressions in the actual documentation.

tests.test_sphinx_crossrefs.built_docs()[source]ΒΆ

Ensure the documentation is built and return the path to the HTML directory.

This fixture builds the documentation if it doesn’t exist or is outdated.

Return type:

Path

tests.test_sphinx_crossrefs.read_html(built_docs, filename)[source]ΒΆ

Read an HTML file from the built documentation.

Return type:

str

Find all href values for links containing the given text.

Returns a list of href values for <a> tags that contain the specified text. The function handles nested tags like <a href=”…”><code><span>text</span></code></a>.

Return type:

list[str]

tests.test_sphinx_crossrefs.has_linked_reference(html, text, expected_href_fragment)[source]ΒΆ

Check if the HTML contains a link with the given text pointing to the expected href.

Return type:

bool

Args:

html: The HTML content to search. text: The link text to find (e.g., β€œAARCH64”, β€œis_linux()”). expected_href_fragment: A fragment that should be in the href (e.g.,

β€œarchitectures.html#extra_platforms.AARCH64”).

Returns:

True if a matching link is found.

Smoke test: verify that specific rendered links point to expected targets.

Parametrized check: the MyST directive in column 1 renders to a link in column 2.

  • myst is the literal MyST role example as shown in the first column of the Reference matrix (e.g. β€œ{data}`~UBUNTU`”).

  • expected_link is the expected href target used in the rendered second column (e.g. β€œplatforms.html#extra_platforms.UBUNTU”).

tests.test_sphinx_crossrefs.get_expected_page_for_symbol(role, symbol)[source]ΒΆ

Determine the expected HTML page for a given symbol.

Return type:

str

Args:

role: The Sphinx role (func, data, class, etc.) symbol: The symbol name (e.g., β€˜UBUNTU’, β€˜is_linux’, β€˜Platform’)

Returns:

The expected HTML filename (e.g., β€˜platforms.html’)

tests.test_sphinx_crossrefs.test_get_expected_page_for_symbol_handles_public_api(symbol_name)[source]ΒΆ

Test that get_expected_page_for_symbol correctly handles each public symbol.

This test validates that our logic correctly maps every symbol exposed in the public API from both extra_platforms and extra_platforms.pytest modules to the correct documentation page.

Args:

symbol_name: The symbol name (e.g., β€œUBUNTU”, β€œis_linux”, β€œpytest.skip_ubuntu”) is_pytest_decorator: True if this is a pytest decorator, False otherwise

tests.test_sphinx_crossrefs.collect_all_refs()[source]ΒΆ

Collect all cross-reference tuples (role, symbol, source_file).

This helper is intentionally executed at collection time to generate parametrization values for the comprehensive cross-reference test.

Return type:

list[tuple[str, str, str]]

tests.test_sphinx_crossrefs.test_all_crossreferences_point_to_correct_pages(built_docs, role, symbol, source_file)[source]ΒΆ

Parametrized check that a single cross-reference points to the expected page.

The previous monolithic test iterated over all refs; this parametrized variant runs the same checks per-reference so failures are reported per-item.

tests.test_sphinx_crossrefs.extract_docstring_from_html(html, symbol_id)[source]ΒΆ

Extract the docstring text for a symbol from HTML content.

This function is used to verify that custom docstrings are properly rendered in the generated HTML documentation, particularly for frozenset collections where Sphinx’s autodoc would normally show the generic frozenset description.

Return type:

str

Args:

html: The HTML content to search. symbol_id: The symbol ID (e.g., β€œextra_platforms.ALL_GROUPS” or

β€œextra_platforms.group_data.ALL_GROUPS”).

Returns:

The docstring text (stripped of HTML tags), or empty string if not found.

tests.test_sphinx_crossrefs.test_frozenset_docstrings_are_custom(built_docs, symbol_name, expected_text_fragment)[source]ΒΆ

Test that frozenset collections have custom docstrings, not the generic one.

This test verifies that the frozenset collections (ALL_GROUPS, ALL_TRAIT_IDS, etc.) are documented with their custom docstrings extracted from #: comments rather than the generic frozenset description.

The canonical location for these symbols is groups.html.

tests.test_sphinx_crossrefs.SPECIALIZED_PAGES = ('architectures.html', 'ci.html', 'detection.html', 'groups.html', 'platforms.html', 'pytest.html', 'shells.html', 'sphinx.html', 'trait.html')ΒΆ

Specialized documentation pages that should never leak links to the generic auto-generated extra_platforms.html page.

Test that specialized doc pages never link to the generic extra_platforms.html.

All cross-references from hand-written documentation pages should resolve to other specialized pages (e.g. architectures.html, groups.html, detection.html), never to the catch-all extra_platforms.html produced by automodule.

tests.test_sphinx_crossrefs.test_generic_api_page_no_stolen_targets(built_docs)[source]ΒΆ

Enforce the policy that extra_platforms.html does not steal targets from specialized pages.

The extra_platforms.rst file uses :noindex: and :no-members: on all submodule automodule directives to prevent members documented in specialized pages from appearing on the generic page. This test checks both anchors (id=) and rendered member signatures (sig-name) to catch leaks even when :noindex: suppresses the anchor.

tests.test_trait moduleΒΆ

tests.test_trait.test_trait_class_metadata(klass)[source]ΒΆ
tests.test_trait.test_all_traits_generated_constants(trait)[source]ΒΆ
tests.test_trait.test_detection_function_missing(caplog)[source]ΒΆ
tests.test_trait.test_aliases_do_not_conflict_with_trait_ids()[source]ΒΆ

Verify no alias conflicts with a canonical trait ID.

tests.test_trait.test_aliases_do_not_conflict_with_group_ids()[source]ΒΆ

Verify no alias conflicts with a group ID.

tests.test_trait.test_aliases_are_unique_across_traits()[source]ΒΆ

Verify no alias is defined by multiple traits.

tests.test_trait.test_shared_icons_belong_to_same_canonical_group()[source]ΒΆ

Icons must be unique across all traits and groups, with one exception.

A canonical group may share its icon with its members, but only if all members of that group use the same icon as the group itself.

tests.test_utils moduleΒΆ

tests.test_utils.test_recursive_update_basic()[source]ΒΆ

Test basic recursive update.

tests.test_utils.test_recursive_update_adds_new_keys()[source]ΒΆ

Test that recursive update ignores keys not in first dict.

tests.test_utils.test_recursive_update_strict_mode()[source]ΒΆ

Test strict mode raises ValueError for unregistered keys.

tests.test_utils.test_recursive_update_deep_nesting()[source]ΒΆ

Test recursive update with deep nesting (3+ levels).

tests.test_utils.test_recursive_update_overwrites_non_dict()[source]ΒΆ

Test that non-dict values are overwritten, not merged.

tests.test_utils.test_recursive_update_preserves_original()[source]ΒΆ

Test that original dict is modified in place.

tests.test_utils.test_remove_blanks_options(blank_type, tree, remove_kwargs, should_remove)[source]ΒΆ

Test removing or keeping different types of blank values.

tests.test_utils.test_remove_blanks_mixed_scenario()[source]ΒΆ

Test removing all blank types in a mixed scenario.

tests.test_utils.test_remove_blanks_all_options_disabled()[source]ΒΆ

Test that nothing is removed when all options are disabled.

tests.test_utils.test_remove_blanks_recursive_cleanup()[source]ΒΆ

Test that nested dicts are cleaned recursively.

tests.test_utils.test_remove_blanks_preserves_non_blank_values()[source]ΒΆ

Test that non-blank values of all types are preserved.