22from contextlib import chdir
33from functools import partial
44from os .path import join as pjoin
5- from typing import List , Set
65from unittest .mock import patch
76
87import pytest
@@ -16,7 +15,7 @@ def test_non_repo_cwd(self, capsys, tool):
1615 with pytest .raises (SystemExit ) as excinfo :
1716 tool .parse_args (["manifest" ])
1817 assert excinfo .value .code == 2
19- out , err = capsys .readouterr ()
18+ _out , err = capsys .readouterr ()
2019 assert err .strip () == "pkgdev manifest: error: not in ebuild repo"
2120
2221 @pytest .mark .skip
@@ -57,7 +56,7 @@ def test_repo_relative_outside(self, tmp_path, repo, capsys, tool):
5756 with chdir (repo .location ):
5857 tool .parse_args (["manifest" , str (ebuild )])
5958 assert excinfo .value .code == 2
60- out , err = capsys .readouterr ()
59+ _out , err = capsys .readouterr ()
6160 assert (
6261 err .strip ()
6362 == f"pkgdev manifest: error: { repo .repo_id !r} repo doesn't contain: { str (ebuild )!r} "
@@ -86,7 +85,7 @@ def test_atom_target(self, repo, capsys, tool):
8685 assert matches == ["cat/pkg-0" ]
8786
8887 def test_if_modified_target (self , repo , make_git_repo , tool ):
89- def manifest_matches () -> Set [str ]:
88+ def manifest_matches () -> set [str ]:
9089 repo .sync ()
9190 with chdir (repo .location ):
9291 options , _ = tool .parse_args (["manifest" , "--if-modified" ])
@@ -136,7 +135,7 @@ def manifest_matches() -> Set[str]:
136135
137136 @pytest .mark .skip
138137 def test_ignore_fetch_restricted (self , repo , tool ):
139- def manifest_matches () -> List [str ]:
138+ def manifest_matches () -> list [str ]:
140139 with chdir (repo .location ):
141140 options , _ = tool .parse_args (["manifest" , "--ignore-fetch-restricted" ])
142141 return [x .cpvstr for x in repo .itermatch (options .restriction )]
@@ -161,14 +160,14 @@ def test_non_repo_dir_target(self, tmp_path, repo, capsys, tool):
161160 with pytest .raises (SystemExit ) as excinfo , chdir (repo .location ):
162161 tool .parse_args (["manifest" , str (tmp_path )])
163162 assert excinfo .value .code == 2
164- out , err = capsys .readouterr ()
163+ _out , err = capsys .readouterr ()
165164 assert err .startswith ("pkgdev manifest: error: 'fake' repo doesn't contain:" )
166165
167166 def test_invalid_atom_target (self , repo , capsys , tool ):
168167 with pytest .raises (SystemExit ) as excinfo , chdir (repo .location ):
169168 tool .parse_args (["manifest" , "=cat/pkg" ])
170169 assert excinfo .value .code == 2
171- out , err = capsys .readouterr ()
170+ _out , err = capsys .readouterr ()
172171 assert err .startswith ("pkgdev manifest: error: invalid atom: '=cat/pkg'" )
173172
174173
@@ -207,7 +206,7 @@ def test_target_within_pkgdir(self, capsys, repo):
207206 ):
208207 self .script ()
209208 assert excinfo .value .code == 0
210- out , err = capsys .readouterr ()
209+ _out , err = capsys .readouterr ()
211210 assert err == ""
212211
213212 def test_good_manifest_quiet (self , capsys , repo ):
@@ -222,24 +221,6 @@ def test_good_manifest_quiet(self, capsys, repo):
222221 out , err = capsys .readouterr ()
223222 assert out == err == ""
224223
225- def test_target_within_pkgdir (self , capsys , repo ):
226- """Any file inside a package dir manifests that package."""
227- repo .create_ebuild ("cat/pkg-0" )
228- pkgdir = os .path .dirname (repo .create_ebuild ("cat/pkg-1" ))
229- os .makedirs (pjoin (pkgdir , "files" ), exist_ok = True )
230- touch (pjoin (pkgdir , "files" , "a.patch" ))
231- for target in ("files/a.patch" , "files" , "metadata.xml" ):
232- touch (pjoin (pkgdir , "metadata.xml" ))
233- with (
234- patch ("sys.argv" , self .args + [target ]),
235- pytest .raises (SystemExit ) as excinfo ,
236- chdir (pkgdir ),
237- ):
238- self .script ()
239- assert excinfo .value .code == 0
240- out , err = capsys .readouterr ()
241- assert err == ""
242-
243224 def test_bad_manifest (self , capsys , repo ):
244225 repo .create_ebuild ("cat/pkg-0" )
245226 repo .create_ebuild ("cat/pkg-1" , eapi = "-1" )
0 commit comments