Commit 63f5827d authored by Taylor Robie's avatar Taylor Robie
Browse files

remove mock to debug kokoro failures

parent c49b8b71
...@@ -22,7 +22,6 @@ from collections import defaultdict ...@@ -22,7 +22,6 @@ from collections import defaultdict
import hashlib import hashlib
import os import os
import mock
import numpy as np import numpy as np
import scipy.stats import scipy.stats
import tensorflow as tf import tensorflow as tf
...@@ -50,12 +49,15 @@ FRESH_RANDOMNESS_MD5 = "63d0dff73c0e5f1048fbdc8c65021e22" ...@@ -50,12 +49,15 @@ FRESH_RANDOMNESS_MD5 = "63d0dff73c0e5f1048fbdc8c65021e22"
def mock_download(*args, **kwargs): def mock_download(*args, **kwargs):
return return
# The forkpool used by data producers interacts badly with the threading
# used by TestCase. Without this patch tests will hang, and no amount
# of diligent closing and joining within the producer will prevent it.
@mock.patch.object(popen_helper, "get_forkpool", popen_helper.get_fauxpool)
class BaseTest(tf.test.TestCase): class BaseTest(tf.test.TestCase):
def setUp(self): def setUp(self):
# The forkpool used by data producers interacts badly with the threading
# used by TestCase. Without this patch tests will hang, and no amount
# of diligent closing and joining within the producer will prevent it.
self._get_forkpool = popen_helper.get_forkpool
popen_helper.get_forkpool = popen_helper.get_fauxpool
self.temp_data_dir = self.get_temp_dir() self.temp_data_dir = self.get_temp_dir()
ratings_folder = os.path.join(self.temp_data_dir, DATASET) ratings_folder = os.path.join(self.temp_data_dir, DATASET)
tf.gfile.MakeDirs(ratings_folder) tf.gfile.MakeDirs(ratings_folder)
...@@ -93,6 +95,9 @@ class BaseTest(tf.test.TestCase): ...@@ -93,6 +95,9 @@ class BaseTest(tf.test.TestCase):
data_preprocessing.DATASET_TO_NUM_USERS_AND_ITEMS[DATASET] = (NUM_USERS, data_preprocessing.DATASET_TO_NUM_USERS_AND_ITEMS[DATASET] = (NUM_USERS,
NUM_ITEMS) NUM_ITEMS)
def tearDown(self):
popen_helper.get_forkpool = self._get_forkpool
def make_params(self, train_epochs=1): def make_params(self, train_epochs=1):
return { return {
"train_epochs": train_epochs, "train_epochs": train_epochs,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment