Skip to content

Commit

Permalink
Merge ba8481e into 5311d0c
Browse files Browse the repository at this point in the history
  • Loading branch information
pgajdos committed Jun 1, 2020
2 parents 5311d0c + ba8481e commit 0949b50
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 34 deletions.
8 changes: 4 additions & 4 deletions featureflow/test_bytestream.py
@@ -1,5 +1,5 @@
from .bytestream import BytesWithTotalLength, ByteStream, ZipWrapper, iter_zip
import unittest2
import unittest
import sys
import tempfile
import subprocess
Expand All @@ -12,7 +12,7 @@
from .util import wait_for_http_server


class BytestreamTests(unittest2.TestCase):
class BytestreamTests(unittest.TestCase):
def setUp(self):
self.HasUri = namedtuple('HasUri', ['uri'])
self.bytestream = ByteStream(chunksize=3)
Expand Down Expand Up @@ -118,7 +118,7 @@ def test_supports_legacy_uri_interface_for_file_like_objects(self):
self.assertEqual(self.expected, results)


class BytesWithTotalLengthTests(unittest2.TestCase):
class BytesWithTotalLengthTests(unittest.TestCase):
def test_left_add(self):
self.assertEqual(
b'fakeblah', BytesWithTotalLength(b'fake', 100) + b'blah')
Expand All @@ -138,7 +138,7 @@ def test_right_increment(self):
self.assertEqual(b'blahfake', x)


class IterZipTests(unittest2.TestCase):
class IterZipTests(unittest.TestCase):
def test_iter_zip_yields_open_zip_files(self):
bio = BytesIO()
filename = 'test.dat'
Expand Down
8 changes: 4 additions & 4 deletions featureflow/test_data.py
@@ -1,12 +1,12 @@
import unittest2
import unittest
from uuid import uuid4
from .data import \
InMemoryDatabase, UserSpecifiedIdProvider, FileSystemDatabase, \
StringDelimitedKeyBuilder
import shutil


class InMemoryDatabaseTest(unittest2.TestCase):
class InMemoryDatabaseTest(unittest.TestCase):
def setUp(self):
self.db = InMemoryDatabase()

Expand Down Expand Up @@ -35,12 +35,12 @@ def test_can_overwrite_key(self):
self.assertEqual(b'test data2', rs.read())


class UserSpecifiedIdProviderTest(unittest2.TestCase):
class UserSpecifiedIdProviderTest(unittest.TestCase):
def test_raises_when_no_key_is_provided(self):
self.assertRaises(ValueError, lambda: UserSpecifiedIdProvider())


class FileSystemDatabaseTests(unittest2.TestCase):
class FileSystemDatabaseTests(unittest.TestCase):
def setUp(self):
self._key_builder = StringDelimitedKeyBuilder()
self._path = '/tmp/{path}'.format(path=uuid4().hex)
Expand Down
4 changes: 2 additions & 2 deletions featureflow/test_datawriter.py
@@ -1,9 +1,9 @@
import unittest2
import unittest
from .datawriter import BytesIODataWriter
from .encoder import IdentityEncoder


class StringIODataWriterTests(unittest2.TestCase):
class StringIODataWriterTests(unittest.TestCase):
def test_overflow(self):
buffer_size_limit = 128
writer = BytesIODataWriter(
Expand Down
4 changes: 2 additions & 2 deletions featureflow/test_eventlog.py
@@ -1,4 +1,4 @@
import unittest2
import unittest
from .eventlog import InMemoryChannel, EventLog
from .model import BaseModel
from .persistence import PersistenceSettings
Expand All @@ -10,7 +10,7 @@
import json


class EventLogTests(unittest2.TestCase):
class EventLogTests(unittest.TestCase):
def setUp(self):
self._dir = tempfile.mkdtemp()

Expand Down
8 changes: 4 additions & 4 deletions featureflow/test_integration.py
@@ -1,7 +1,7 @@
import requests
import http.client
from .util import wait_for_http_server
import unittest2
import unittest
from collections import defaultdict
import random
from requests.exceptions import HTTPError
Expand Down Expand Up @@ -1761,7 +1761,7 @@ class A(BaseModel, self.Settings):
self.assertEqual(data_source['lorem'].lower(), b''.join(doc.lowercase))


class InMemoryTest(BaseTest, unittest2.TestCase):
class InMemoryTest(BaseTest, unittest.TestCase):
def setUp(self):
class Settings(PersistenceSettings):
id_provider = UuidProvider()
Expand All @@ -1771,7 +1771,7 @@ class Settings(PersistenceSettings):
self.Settings = Settings


class FileSystemTest(BaseTest, unittest2.TestCase):
class FileSystemTest(BaseTest, unittest.TestCase):
def setUp(self):
self._dir = mkdtemp()

Expand All @@ -1787,7 +1787,7 @@ def tearDown(self):
rmtree(self._dir)


class LmdbTest(BaseTest, unittest2.TestCase):
class LmdbTest(BaseTest, unittest.TestCase):
def setUp(self):
self._dir = mkdtemp()

Expand Down
4 changes: 2 additions & 2 deletions featureflow/test_lmdbstore.py
@@ -1,4 +1,4 @@
import unittest2
import unittest
from .lmdbstore import LmdbDatabase
from uuid import uuid4
from .data import StringDelimitedKeyBuilder
Expand Down Expand Up @@ -45,7 +45,7 @@ def db_count(d):
return len(list(EphemeralLmdb(dir=d).db.iter_ids()))


class LmdbDatabaseTests(unittest2.TestCase):
class LmdbDatabaseTests(unittest.TestCase):
def setUp(self):
self.value = os.urandom(1000)
self.init_database()
Expand Down
4 changes: 2 additions & 2 deletions featureflow/test_multiprocessing.py
@@ -1,4 +1,4 @@
import unittest2
import unittest
from .feature import Feature, JSONFeature
from .lmdbstore import LmdbDatabase
from .model import BaseModel
Expand Down Expand Up @@ -28,7 +28,7 @@ def get_count(_):
return len(list(D.database.iter_ids()))


class MultiProcessTests(unittest2.TestCase):
class MultiProcessTests(unittest.TestCase):
def test_can_list_ids_from_multiple_processes(self):
D.process(stream='Here is some text')
D.process(stream='Here is some more')
Expand Down
14 changes: 7 additions & 7 deletions featureflow/test_nmpy.py
@@ -1,4 +1,4 @@
import unittest2
import unittest

try:
import numpy as np
Expand Down Expand Up @@ -94,13 +94,13 @@ def test_can_store_and_retrieve_recarray(self):
('y', 'a32')])


class GreedyNumpyTest(BaseNumpyTest, unittest2.TestCase):
class GreedyNumpyTest(BaseNumpyTest, unittest.TestCase):
def _register_database(self, settings_class):
return settings_class.clone(
database=InMemoryDatabase(key_builder=settings_class.key_builder))


class GreedyNumpyOnDiskTest(BaseNumpyTest, unittest2.TestCase):
class GreedyNumpyOnDiskTest(BaseNumpyTest, unittest.TestCase):
def _register_database(self, settings_class):
self._dir = mkdtemp()
return settings_class.clone(database=FileSystemDatabase(
Expand All @@ -111,7 +111,7 @@ def tearDown(self):
rmtree(self._dir)


class GreedyNumpyLmdbTest(BaseNumpyTest, unittest2.TestCase):
class GreedyNumpyLmdbTest(BaseNumpyTest, unittest.TestCase):
def _register_database(self, settings_class):
self._dir = mkdtemp()
return settings_class.clone(database=LmdbDatabase(
Expand All @@ -123,7 +123,7 @@ def tearDown(self):
rmtree(self._dir)


class StreamingNumpyTest(BaseNumpyTest, unittest2.TestCase):
class StreamingNumpyTest(BaseNumpyTest, unittest.TestCase):
def _register_database(self, settings_class):
return settings_class.clone(
database=InMemoryDatabase(key_builder=settings_class.key_builder))
Expand All @@ -147,7 +147,7 @@ def _restore(self, data):
return np.concatenate(list(data))


class StreamingNumpyOnDiskTest(BaseNumpyTest, unittest2.TestCase):
class StreamingNumpyOnDiskTest(BaseNumpyTest, unittest.TestCase):
def _register_database(self, settings_class):
self._dir = mkdtemp()
return settings_class.clone(database=FileSystemDatabase(
Expand Down Expand Up @@ -176,7 +176,7 @@ def _restore(self, data):
return np.concatenate(list(data))


class StreamingNumpyLmdbTest(BaseNumpyTest, unittest2.TestCase):
class StreamingNumpyLmdbTest(BaseNumpyTest, unittest.TestCase):
def _register_database(self, settings_class):
self._dir = mkdtemp()
return settings_class.clone(database=LmdbDatabase(
Expand Down
4 changes: 2 additions & 2 deletions featureflow/test_objectstorage.py
@@ -1,10 +1,10 @@
import unittest2
import unittest
from .objectstore import WriteStream
import http.client
from collections import namedtuple


class WriteStreamTests(unittest2.TestCase):
class WriteStreamTests(unittest.TestCase):
def test_write_stream_does_not_put_zero_bytes(self):
class TestWriteStream(WriteStream):
def __init__(self):
Expand Down
4 changes: 2 additions & 2 deletions featureflow/test_persistence.py
@@ -1,12 +1,12 @@
import unittest2
import unittest
from .persistence import simple_in_memory_settings
from .bytestream import ByteStream, ByteStreamFeature
from .feature import Feature, TextFeature
from .model import BaseModel
from io import BytesIO


class SimpleInMemorySettingsDecoratorTests(unittest2.TestCase):
class SimpleInMemorySettingsDecoratorTests(unittest.TestCase):
def test_can_process_document_using_decorated_class(self):
@simple_in_memory_settings
class Document(BaseModel):
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
@@ -1,5 +1,4 @@
redis
nose
unittest2
requests
lmdb
lmdb
1 change: 0 additions & 1 deletion setup.py
Expand Up @@ -30,7 +30,6 @@
install_requires=[
'dill',
'nose',
'unittest2',
'certifi==2017.7.27.1',
'requests',
'lmdb',
Expand Down

0 comments on commit 0949b50

Please sign in to comment.