Skip to content

Use absolute import path #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions tests/base.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import unittest
import tensorflow as tf
import unittest


def train_input_fn(features, labels, batch_size=32):
dataset = tf.data.Dataset.from_tensor_slices((dict(features), labels))
dataset = dataset.shuffle(1000).repeat().batch(batch_size)
return dataset


def eval_input_fn(features, labels, batch_size=32):
dataset = tf.data.Dataset.from_tensor_slices((dict(features), labels))
dataset = dataset.batch(batch_size)
return dataset


class BaseTestCases:
class BaseTest(object):
class BaseTest(unittest.TestCase):
def setUp(self):
self.model, self.features, self.label = None, {}, None

Expand Down
2 changes: 1 addition & 1 deletion tests/test_dnnclassifier.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sqlflow_models
from .base import BaseTestCases
from tests.base import BaseTestCases

import tensorflow as tf
import unittest
Expand Down
2 changes: 1 addition & 1 deletion tests/test_lstm.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sqlflow_models
from .base import BaseTestCases
from tests.base import BaseTestCases

import tensorflow as tf
import numpy as np
Expand Down
1 change: 0 additions & 1 deletion tests/test_version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import sqlflow_models
import unittest


def test_answer():
Expand Down