From 6368a859f9cf878f881f9e6a6391e2ade52bbf73 Mon Sep 17 00:00:00 2001 From: Mike Kelly Date: Fri, 8 Nov 2024 12:15:47 +0000 Subject: [PATCH] Apply `#pragma: no cover` to test classes. These classes are never instantiated, only compared, so the `coverage` tool highlights them as not being covered by testing unless we mark them up as such. --- tests/verification/test_utils.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/verification/test_utils.py b/tests/verification/test_utils.py index dfba42016..0db15c853 100644 --- a/tests/verification/test_utils.py +++ b/tests/verification/test_utils.py @@ -12,7 +12,7 @@ class TestPublicMethodSignatureEquality: def test_identity(self): """Test when applied against the same class.""" - class ClassA: + class ClassA: # pragma: no cover - Test class that is never instantiated. def method_one(self, x, y): ... def method_two(self, z): ... @@ -22,13 +22,13 @@ def method_two(self, z): ... def test_matching_methods(self): """Test when methods match between classes.""" - class ClassA: + class ClassA: # pragma: no cover - Test class that is never instantiated. def method_one(self, x, y): ... def method_two(self, z): ... # This class is identical to Class A. - class ClassB: + class ClassB: # pragma: no cover - Test class that is never instantiated. def method_one(self, x, y): ... def method_two(self, z): ... @@ -38,13 +38,13 @@ def method_two(self, z): ... def test_signature_mismatch(self): """Test when method signatures differ between classes.""" - class ClassA: + class ClassA: # pragma: no cover - Test class that is never instantiated. def method_one(self, x, y): ... def method_two(self, z): ... # The same as A, but a method has a different signature. - class ClassC: + class ClassC: # pragma: no cover - Test class that is never instantiated. # Different signature to A.method_one. def method_one(self, x): ... @@ -56,13 +56,13 @@ def method_two(self, z): ... def test_extra_method(self): """Test when the second class has an extra method.""" - class ClassA: + class ClassA: # pragma: no cover - Test class that is never instantiated. def method_one(self, x, y): ... def method_two(self, z): ... # The same as A, but with an extra method. - class ClassD: + class ClassD: # pragma: no cover - Test class that is never instantiated. def method_one(self, x, y): ... def method_two(self, z): ... @@ -75,13 +75,13 @@ def method_three(self): ... def test_missing_method(self): """Test when a method is missing in the second class.""" - class ClassA: + class ClassA: # pragma: no cover - Test class that is never instantiated. def method_one(self, x, y): ... def method_two(self, z): ... # The same as A, but with an extra method. - class ClassD: + class ClassD: # pragma: no cover - Test class that is never instantiated. def method_one(self, x, y): ... def method_two(self, z): ... @@ -94,13 +94,13 @@ def method_three(self): ... def test_ignore_methods(self): """Test when certain methods are ignored in the comparison.""" - class ClassA: + class ClassA: # pragma: no cover - Test class that is never instantiated. def method_one(self, x, y): ... def method_two(self, z): ... # The same as A, but with an extra method. - class ClassD: + class ClassD: # pragma: no cover - Test class that is never instantiated. def method_one(self, x, y): ... def method_two(self, z): ... @@ -114,13 +114,13 @@ def method_three(self): ... def test_ignore_private_methods(self): """Test that extra private methods are ignored.""" - class ClassA: + class ClassA: # pragma: no cover - Test class that is never instantiated. def method_one(self, x, y): ... def method_two(self, z): ... # The same as A, but with a private method. - class ClassE: + class ClassE: # pragma: no cover - Test class that is never instantiated. def method_one(self, x, y): ... def method_two(self, z): ...