commit:     ead49338e36f9abfa034a6669955c4da2963c771
Author:     Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Wed Jan 21 18:33:24 2026 +0000
Commit:     Brian Harring <ferringb <AT> gmail <DOT> com>
CommitDate: Wed Jan 21 18:39:17 2026 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/snakeoil.git/commit/?id=ead49338

clean out dead variable assignments

Signed-off-by: Brian Harring <ferringb <AT> gmail.com>

 tests/cli/test_arghparse.py | 12 ++++++------
 tests/test_caching.py       |  3 ++-
 tests/test_mappings.py      |  2 +-
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/tests/cli/test_arghparse.py b/tests/cli/test_arghparse.py
index 5908ee4..63d37ae 100644
--- a/tests/cli/test_arghparse.py
+++ b/tests/cli/test_arghparse.py
@@ -175,7 +175,7 @@ class TestArgumentParser(TestCsvActionsParser, 
TestOptionalsParser):
 
         # ensure the option isn't there if disabled
         with pytest.raises(argparse_helpers.Error):
-            namespace = parser.parse_args(["--debug"])
+            parser.parse_args(["--debug"])
 
         namespace = parser.parse_args([])
         # parser attribute still exists
@@ -212,7 +212,7 @@ class TestArgumentParser(TestCsvActionsParser, 
TestOptionalsParser):
         # ensure the options aren't there if disabled
         for args in ("-q", "--quiet", "-v", "--verbose"):
             with pytest.raises(argparse_helpers.Error):
-                namespace = parser.parse_args([args])
+                parser.parse_args([args])
 
         namespace = parser.parse_args([])
         # parser attribute still exists
@@ -269,7 +269,7 @@ class ParseStdinTest(BaseArgparseOptions):
         # stdin is an interactive tty
         with mock.patch("sys.stdin.isatty", return_value=True):
             with pytest.raises(argparse_helpers.Error) as excinfo:
-                namespace = self.parser.parse_args(["-"])
+                self.parser.parse_args(["-"])
             assert "only valid when piping data in" in str(excinfo.value)
 
         # fake piping data in
@@ -353,7 +353,7 @@ class 
TestCommaSeparatedNegationsAction(TestCommaSeparatedValuesAction):
         self.parser.add_argument("--testing", action=self.action)
         for arg in self.bad_args:
             with pytest.raises(argparse.ArgumentTypeError) as excinfo:
-                namespace = self.parser.parse_args(["--testing=" + arg])
+                self.parser.parse_args(["--testing=" + arg])
             assert "without a token" in str(excinfo.value)
 
 
@@ -477,7 +477,7 @@ class TestManHelpAction:
         with mock.patch("subprocess.Popen") as popen:
             # --help long option tries man page first before falling back to 
help output
             with pytest.raises(argparse_helpers.Exit):
-                namespace = parser.parse_args(["--help"])
+                parser.parse_args(["--help"])
             popen.assert_called_once()
             assert popen.call_args[0][0][0] == "man"
             captured = capsys.readouterr()
@@ -486,7 +486,7 @@ class TestManHelpAction:
 
             # -h short option just displays the regular help output
             with pytest.raises(argparse_helpers.Exit):
-                namespace = parser.parse_args(["-h"])
+                parser.parse_args(["-h"])
             popen.assert_not_called()
             captured = capsys.readouterr()
             assert captured.out.strip().startswith("usage: ")

diff --git a/tests/test_caching.py b/tests/test_caching.py
index 1f454de..feea997 100644
--- a/tests/test_caching.py
+++ b/tests/test_caching.py
@@ -167,7 +167,8 @@ class TestWeakInstMeta:
         _myid = id(o)
         del o
         gc.collect()
-        o = weak_inst(unique)
+        # This *must* be pinned, thus the empty assign.
+        o = weak_inst(unique)  # noqa: F841
         assert weak_inst.counter == 2
 
     def test_function_metadata(self):

diff --git a/tests/test_mappings.py b/tests/test_mappings.py
index 694a8a9..d124838 100644
--- a/tests/test_mappings.py
+++ b/tests/test_mappings.py
@@ -247,7 +247,7 @@ class TestImmutableDict:
     def test_init_bad_data(self):
         for data in (range(10), list(range(10)), [([], 1)]):
             with pytest.raises(TypeError):
-                d = mappings.ImmutableDict(data)
+                mappings.ImmutableDict(data)
 
     def test_str(self):
         d = {1: 1, 2: 2}

Reply via email to