Skip to content
Snippets Groups Projects
Commit bf3849ec authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Merge branch 'doctest' into 'master'

[sphinx] Fixed doc test

See merge request !82
parents 08fb3a61 b2923317
No related branches found
No related tags found
1 merge request!82[sphinx] Fixed doc test
Pipeline #35523 passed
...@@ -6,9 +6,11 @@ from bob.learn.tensorflow.utils.hooks import EarlyStopping, EarlyStopException ...@@ -6,9 +6,11 @@ from bob.learn.tensorflow.utils.hooks import EarlyStopping, EarlyStopException
import nose import nose
import tensorflow as tf import tensorflow as tf
import shutil import shutil
from nose.plugins.attrib import attr
@nose.tools.raises(EarlyStopException) @nose.tools.raises(EarlyStopException)
@attr('slow')
def test_early_stopping_linear_classifier(): def test_early_stopping_linear_classifier():
config = read_config_files([ config = read_config_files([
datafile('mnist_input_fn.py', __name__), datafile('mnist_input_fn.py', __name__),
...@@ -34,6 +36,7 @@ def test_early_stopping_linear_classifier(): ...@@ -34,6 +36,7 @@ def test_early_stopping_linear_classifier():
@nose.tools.raises(EarlyStopException) @nose.tools.raises(EarlyStopException)
@attr('slow')
def test_early_stopping_logit_trainer(): def test_early_stopping_logit_trainer():
config = read_config_files([ config = read_config_files([
datafile('mnist_input_fn.py', __name__), datafile('mnist_input_fn.py', __name__),
......
...@@ -12,6 +12,7 @@ import pkg_resources ...@@ -12,6 +12,7 @@ import pkg_resources
from bob.learn.tensorflow.utils.hooks import LoggerHookEstimator from bob.learn.tensorflow.utils.hooks import LoggerHookEstimator
from bob.learn.tensorflow.loss import mean_cross_entropy_loss from bob.learn.tensorflow.loss import mean_cross_entropy_loss
from nose.plugins.attrib import attr
import shutil import shutil
import os import os
...@@ -26,7 +27,7 @@ validation_batch_size = 250 ...@@ -26,7 +27,7 @@ validation_batch_size = 250
epochs = 1 epochs = 1
steps = 5000 steps = 5000
@attr('slow')
def test_logitstrainer_images(): def test_logitstrainer_images():
# Trainer logits # Trainer logits
try: try:
......
...@@ -18,6 +18,7 @@ from .test_estimator_onegraph import run_logitstrainer_mnist ...@@ -18,6 +18,7 @@ from .test_estimator_onegraph import run_logitstrainer_mnist
from bob.learn.tensorflow.estimators import Logits from bob.learn.tensorflow.estimators import Logits
from bob.learn.tensorflow.network import dummy from bob.learn.tensorflow.network import dummy
from bob.learn.tensorflow.script.style_transfer import style_transfer from bob.learn.tensorflow.script.style_transfer import style_transfer
from nose.plugins.attrib import attr
dummy_config = datafile('style_transfer.py', __name__) dummy_config = datafile('style_transfer.py', __name__)
CONFIG = ''' CONFIG = '''
...@@ -46,7 +47,7 @@ batch_size = 32 ...@@ -46,7 +47,7 @@ batch_size = 32
epochs = 1 epochs = 1
steps = 100 steps = 100
@attr('slow')
def test_style_transfer(): def test_style_transfer():
with open(dummy_config, 'w') as f: with open(dummy_config, 'w') as f:
f.write(CONFIG) f.write(CONFIG)
......
...@@ -36,7 +36,8 @@ The Boston Housing Prices dataset ...@@ -36,7 +36,8 @@ The Boston Housing Prices dataset
.. doctest:: .. doctest::
>>> boston_housing = keras.datasets.boston_housing >>> boston_housing = keras.datasets.boston_housing
>>> (train_data, train_labels), (test_data, test_labels) = boston_housing.load_data() >>> print("doctest s**t"); (train_data, train_labels), (test_data, test_labels) = boston_housing.load_data() # doctest: +ELLIPSIS
doc...
>>> print("Training set: {}".format(train_data.shape)) >>> print("Training set: {}".format(train_data.shape))
Training set: (404, 13) Training set: (404, 13)
>>> print("Testing set: {}".format(test_data.shape)) >>> print("Testing set: {}".format(test_data.shape))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment