Skip to content

Commit

Permalink
Apply #pragma: no cover to test classes.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mikerkelly committed Nov 8, 2024
1 parent d719e00 commit 6368a85
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions tests/verification/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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): ...
Expand All @@ -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): ...
Expand All @@ -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): ...

Expand All @@ -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): ...
Expand All @@ -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): ...
Expand All @@ -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): ...
Expand All @@ -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): ...
Expand Down

0 comments on commit 6368a85

Please sign in to comment.