Option C Tools
Loading...
Searching...
No Matches
tests_core.conftest Namespace Reference

Functions

bool can_symlink (tmp_path_factory)
bool _git_available ()
Path git_repo (Path tmp_path)
None commit_file (Path repo, str name, str content, str message)

Detailed Description

Purpose
-------
Provide shared fixtures for ``oct.core`` tests, in particular the git
integration tests in ``test_git.py`` (Phase 4A / G-A6).

Responsibilities
----------------
- ``git_repo``: initialise a real git repository in a pytest tmp_path
  and return its resolved path. Skips the test if the ``git`` binary is
  not available on the host.
- ``can_symlink``: cached session-scoped probe that determines whether
  the platform allows creating symlinks in a temp directory (Linux/
  macOS always, Windows only with Developer Mode or admin).

Diagnostics
-----------
Domain: CORE-TESTS
Levels:
    L2 — fixture lifecycle
    L3 — fixture setup details
    L4 — deep tracing

Contracts
---------
- ``git_repo`` always returns a directory that is a real git working
  tree with ``user.name`` / ``user.email`` pre-configured so that
  commit operations in tests do not fail on unconfigured identity.
- ``can_symlink`` must never raise; it returns ``True`` or ``False``.

Function Documentation

◆ _git_available()

bool tests_core.conftest._git_available ( )
protected

Definition at line 58 of file conftest.py.

Here is the caller graph for this function:

◆ can_symlink()

bool tests_core.conftest.can_symlink ( tmp_path_factory)
Session-cached probe: True if symlink creation works on this host.

Definition at line 45 of file conftest.py.

◆ commit_file()

None tests_core.conftest.commit_file ( Path repo,
str name,
str content,
str message )
Helper: write a file, stage it, commit it. Used by several tests.

Definition at line 88 of file conftest.py.

◆ git_repo()

Path tests_core.conftest.git_repo ( Path tmp_path)
Initialise a real git repo in tmp_path; skip if git is missing.

Definition at line 63 of file conftest.py.

Here is the call graph for this function: