提交 6ca7b2b6 authored 作者: abergeron's avatar abergeron

Merge pull request #3389 from mohammadpz/nose_fix

test function is moved to another function
...@@ -3,4 +3,3 @@ try: ...@@ -3,4 +3,3 @@ try:
from theano.tests.main import main, TheanoNoseTester from theano.tests.main import main, TheanoNoseTester
except ImportError: except ImportError:
pass pass
from theano.tests import unittest_tools
...@@ -3,12 +3,7 @@ import os ...@@ -3,12 +3,7 @@ import os
import unittest import unittest
import sys import sys
from nose.config import Config
from nose.plugins.manager import PluginManager
import nose.plugins.builtin
from numpy.testing.nosetester import NoseTester from numpy.testing.nosetester import NoseTester
from numpy.testing.noseclasses import KnownFailure, NumpyTestProgram
# This class contains code adapted from NumPy, # This class contains code adapted from NumPy,
...@@ -56,6 +51,7 @@ class TheanoNoseTester(NoseTester): ...@@ -56,6 +51,7 @@ class TheanoNoseTester(NoseTester):
Takes the same arguments as `test`. Takes the same arguments as `test`.
""" """
import nose.plugins.builtin
# compile argv # compile argv
argv = self._test_argv(verbose, extra_argv) argv = self._test_argv(verbose, extra_argv)
...@@ -72,6 +68,7 @@ class TheanoNoseTester(NoseTester): ...@@ -72,6 +68,7 @@ class TheanoNoseTester(NoseTester):
# construct list of plugins # construct list of plugins
plugins = [] plugins = []
if knownfailure: if knownfailure:
from numpy.testing.noseclasses import KnownFailure
plugins.append(KnownFailure()) plugins.append(KnownFailure())
plugins += [p() for p in nose.plugins.builtin.plugins] plugins += [p() for p in nose.plugins.builtin.plugins]
...@@ -107,6 +104,9 @@ class TheanoNoseTester(NoseTester): ...@@ -107,6 +104,9 @@ class TheanoNoseTester(NoseTester):
:returns: Returns the result of running the tests as a :returns: Returns the result of running the tests as a
``nose.result.TextTestResult`` object. ``nose.result.TextTestResult`` object.
""" """
from nose.config import Config
from nose.plugins.manager import PluginManager
from numpy.testing.noseclasses import NumpyTestProgram
# Many Theano tests suppose device=cpu, so we need to raise an # Many Theano tests suppose device=cpu, so we need to raise an
# error if device==gpu. # error if device==gpu.
if not os.path.exists('theano/__init__.py'): if not os.path.exists('theano/__init__.py'):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论