@@ -66,7 +66,7 @@ def vcs_user(vcs_name: str, vcs_email: str) -> str:
6666
6767
6868@pytest .fixture (scope = "session" )
69- def git_commit_envvars (vcs_name : str , vcs_email : str ) -> _ENV :
69+ def git_commit_envvars (vcs_name : str , vcs_email : str ) -> GitCommitEnvVars :
7070 """Return environment variables for `git commit`.
7171
7272 For some reason, `GIT_CONFIG` via {func}`set_gitconfig` doesn't work for `git
@@ -266,6 +266,9 @@ def unique_repo_name(remote_repos_path: pathlib.Path, max_retries: int = 15) ->
266266
267267
268268InitCmdArgs : t .TypeAlias = list [str ] | None
269+ GitCommitEnvVars : t .TypeAlias = dict [str , str ]
270+ """Environment variable mapping passed to ``git commit`` subprocess calls."""
271+ Env : t .TypeAlias = _ENV
269272
270273
271274class CreateRepoPostInitFn (t .Protocol ):
@@ -274,13 +277,13 @@ class CreateRepoPostInitFn(t.Protocol):
274277 def __call__ (
275278 self ,
276279 remote_repo_path : pathlib .Path ,
277- env : _ENV | None = None ,
280+ env : Env | None = None ,
278281 ) -> None :
279282 """Ran after creating a repo from pytest fixture."""
280283 ...
281284
282285
283- class CreateRepoPytestFixtureFn (t .Protocol ):
286+ class CreateRepoFn (t .Protocol ):
284287 """Typing for VCS pytest fixture callback."""
285288
286289 def __call__ (
@@ -301,7 +304,7 @@ def _create_git_remote_repo(
301304 remote_repo_path : pathlib .Path ,
302305 remote_repo_post_init : CreateRepoPostInitFn | None = None ,
303306 init_cmd_args : InitCmdArgs = DEFAULT_GIT_REMOTE_REPO_CMD_ARGS ,
304- env : _ENV | None = None ,
307+ env : Env | None = None ,
305308) -> pathlib .Path :
306309 if init_cmd_args is None :
307310 init_cmd_args = []
@@ -374,7 +377,7 @@ def empty_git_repo(
374377def create_git_remote_bare_repo (
375378 remote_repos_path : pathlib .Path ,
376379 empty_git_bare_repo : pathlib .Path ,
377- ) -> CreateRepoPytestFixtureFn :
380+ ) -> CreateRepoFn :
378381 """Return factory to create git remote repo to for clone / push purposes."""
379382
380383 def fn (
@@ -403,7 +406,7 @@ def fn(
403406def create_git_remote_repo (
404407 remote_repos_path : pathlib .Path ,
405408 empty_git_repo : pathlib .Path ,
406- ) -> CreateRepoPytestFixtureFn :
409+ ) -> CreateRepoFn :
407410 """Return factory to create git remote repo to for clone / push purposes."""
408411
409412 def fn (
@@ -434,7 +437,7 @@ def fn(
434437
435438def git_remote_repo_single_commit_post_init (
436439 remote_repo_path : pathlib .Path ,
437- env : _ENV | None = None ,
440+ env : Env | None = None ,
438441) -> None :
439442 """Post-initialization: Create a test git repo with a single commit."""
440443 testfile_filename = "testfile.test"
@@ -454,9 +457,9 @@ def git_remote_repo_single_commit_post_init(
454457@pytest .fixture (scope = "session" )
455458@skip_if_git_missing
456459def git_remote_repo (
457- create_git_remote_repo : CreateRepoPytestFixtureFn ,
460+ create_git_remote_repo : CreateRepoFn ,
458461 gitconfig : pathlib .Path ,
459- git_commit_envvars : _ENV ,
462+ git_commit_envvars : GitCommitEnvVars ,
460463) -> pathlib .Path :
461464 """Copy the session-scoped Git repository to a temporary directory."""
462465 # TODO: Cache the effect of of this in a session-based repo
@@ -490,7 +493,7 @@ def _create_svn_remote_repo(
490493
491494def svn_remote_repo_single_commit_post_init (
492495 remote_repo_path : pathlib .Path ,
493- env : _ENV | None = None ,
496+ env : Env | None = None ,
494497) -> None :
495498 """Post-initialization: Create a test SVN repo with a single commit."""
496499 assert remote_repo_path .exists ()
@@ -541,7 +544,7 @@ def empty_svn_repo(
541544def create_svn_remote_repo (
542545 remote_repos_path : pathlib .Path ,
543546 empty_svn_repo : pathlib .Path ,
544- ) -> CreateRepoPytestFixtureFn :
547+ ) -> CreateRepoFn :
545548 """Pre-made svn repo, bare, used as a file:// remote to checkout and commit to."""
546549
547550 def fn (
@@ -571,7 +574,7 @@ def fn(
571574@pytest .fixture (scope = "session" )
572575@skip_if_svn_missing
573576def svn_remote_repo (
574- create_svn_remote_repo : CreateRepoPytestFixtureFn ,
577+ create_svn_remote_repo : CreateRepoFn ,
575578) -> pathlib .Path :
576579 """Pre-made. Local file:// based SVN server."""
577580 return create_svn_remote_repo ()
@@ -580,7 +583,7 @@ def svn_remote_repo(
580583@pytest .fixture (scope = "session" )
581584@skip_if_svn_missing
582585def svn_remote_repo_with_files (
583- create_svn_remote_repo : CreateRepoPytestFixtureFn ,
586+ create_svn_remote_repo : CreateRepoFn ,
584587) -> pathlib .Path :
585588 """Pre-made. Local file:// based SVN server."""
586589 repo_path = create_svn_remote_repo ()
@@ -610,7 +613,7 @@ def _create_hg_remote_repo(
610613
611614def hg_remote_repo_single_commit_post_init (
612615 remote_repo_path : pathlib .Path ,
613- env : _ENV | None = None ,
616+ env : Env | None = None ,
614617) -> None :
615618 """Post-initialization: Create a test mercurial repo with a single commit."""
616619 testfile_filename = "testfile.test"
@@ -647,7 +650,7 @@ def create_hg_remote_repo(
647650 remote_repos_path : pathlib .Path ,
648651 empty_hg_repo : pathlib .Path ,
649652 hgconfig : pathlib .Path ,
650- ) -> CreateRepoPytestFixtureFn :
653+ ) -> CreateRepoFn :
651654 """Pre-made hg repo, bare, used as a file:// remote to checkout and commit to."""
652655
653656 def fn (
@@ -681,7 +684,7 @@ def fn(
681684@skip_if_hg_missing
682685def hg_remote_repo (
683686 remote_repos_path : pathlib .Path ,
684- create_hg_remote_repo : CreateRepoPytestFixtureFn ,
687+ create_hg_remote_repo : CreateRepoFn ,
685688 hgconfig : pathlib .Path ,
686689) -> pathlib .Path :
687690 """Pre-made, file-based repo for push and pull."""
@@ -787,11 +790,11 @@ def add_doctest_fixtures(
787790 doctest_namespace : dict [str , t .Any ],
788791 tmp_path : pathlib .Path ,
789792 set_home : pathlib .Path ,
790- git_commit_envvars : _ENV ,
793+ git_commit_envvars : GitCommitEnvVars ,
791794 hgconfig : pathlib .Path ,
792- create_git_remote_repo : CreateRepoPytestFixtureFn ,
793- create_svn_remote_repo : CreateRepoPytestFixtureFn ,
794- create_hg_remote_repo : CreateRepoPytestFixtureFn ,
795+ create_git_remote_repo : CreateRepoFn ,
796+ create_svn_remote_repo : CreateRepoFn ,
797+ create_hg_remote_repo : CreateRepoFn ,
795798 git_repo : pathlib .Path ,
796799) -> None :
797800 """Harness pytest fixtures to pytest's doctest namespace."""
0 commit comments