Skip to content

Commit 6f47e47

Browse files
committed
Remove Python 2 specific code from tests
1 parent 0a49a79 commit 6f47e47

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

tests/decoder_test.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,11 @@
22
# -*- coding: utf-8 -*-
33

44
import mmap
5-
import sys
65

76
from maxminddb.decoder import Decoder
87

98
import unittest
109

11-
if sys.version_info[0] == 2:
12-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
13-
unittest.TestCase.assertRegex = unittest.TestCase.assertRegexpMatches
14-
1510

1611
class TestDecoder(unittest.TestCase):
1712
def test_arrays(self):

tests/reader_test.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import os
66
import sys
77
import threading
8+
import unittest
89
from multiprocessing import Process, Pipe
910

1011
import mock
@@ -26,15 +27,6 @@
2627
MODE_FD,
2728
)
2829

29-
if sys.version_info[:2] == (2, 6):
30-
import unittest2 as unittest
31-
else:
32-
import unittest
33-
34-
if sys.version_info[0] == 2:
35-
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
36-
unittest.TestCase.assertRegex = unittest.TestCase.assertRegexpMatches
37-
3830

3931
def get_reader_from_file_descriptor(filepath, mode):
4032
"""Patches open_database() for class TestFDReader()."""
@@ -432,14 +424,6 @@ def test_multiprocessing(self):
432424
def test_threading(self):
433425
self._check_concurrency(threading.Thread)
434426

435-
if sys.version_info[0] == 2:
436-
437-
def test_byte_ip_on_python2(self):
438-
reader = open_database(
439-
"tests/data/test-data/MaxMind-DB-test-decoder.mmdb", self.mode
440-
)
441-
record = reader.get(b"::1.1.1.0")
442-
443427
def _check_concurrency(self, worker_class):
444428
reader = open_database(
445429
"tests/data/test-data/GeoIP2-Domain-Test.mmdb", self.mode

0 commit comments

Comments
 (0)