Skip to content

Commit 72ed288

Browse files
committed
Don't derive from unittest.TestCase when not necessary
1 parent 70862e4 commit 72ed288

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

tests/database_test.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import ipaddress
22
import re
3-
import unittest
43
from unittest.mock import patch, MagicMock
54

65
import pytest
@@ -15,7 +14,7 @@
1514
maxminddb.extension = None # type: ignore
1615

1716

18-
class TestReader(unittest.TestCase):
17+
class TestReader:
1918
def test_language_list(self) -> None:
2019
reader = geoip2.database.Reader(
2120
"tests/data/test-data/GeoIP2-Country-Test.mmdb",

tests/models_test.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33
import pytest
44
from typing import Dict
5-
import unittest
65

76
import geoip2.models
87

98

10-
class TestModels(unittest.TestCase):
9+
class TestModels:
1110
def test_insights_full(self) -> None:
1211
raw = {
1312
"city": {
@@ -313,7 +312,7 @@ def test_unknown_keys(self) -> None:
313312
assert model.traits.ip_address == "1.2.3.4", "correct ip"
314313

315314

316-
class TestNames(unittest.TestCase):
315+
class TestNames:
317316
raw: Dict = {
318317
"continent": {
319318
"code": "NA",

0 commit comments

Comments
 (0)