提交 74230ed3 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Change nosetests -> theano-nose in documentation

上级 87e10dc8
...@@ -65,31 +65,38 @@ How to Run Unit Tests ? ...@@ -65,31 +65,38 @@ How to Run Unit Tests ?
Two options are available: Two options are available:
Nosetests theano-nose
~~~~~~~~~ ~~~~~~~~~~~
The easiest by far is to use ``nosetests`` which is a command line The easiest by far is to use ``theano-nose`` which is a command line
utility that recurses through a given directory, finds all unittests utility that recurses through a given directory, finds all unittests
matching a specific criteria and executes them. By default, it will matching a specific criteria and executes them. By default, it will
find & execute tests case in test*.py files whose method name starts find & execute tests case in test*.py files whose method name starts
with 'test'. with 'test'.
``theano-nose`` is a wrapper around `nosetests
<http://somethingaboutorange.com/mrl/projects/nose/>`_. You should be
able to execute it if you installed Theano using pip, or if you ran
"python setup.py develop" after the installation. If ``theano-nose`` is
not found by your shell, you will need to add ``Theano/bin`` to your
``PATH`` environment variable.
Running all unit tests :: Running all unit tests ::
cd Theano/theano cd Theano/theano
nosetests theano-nose
Running unit tests with standard out :: Running unit tests with standard out ::
nosetests -s theano-nose -s
Running unit tests contained in a specific .py file :: Running unit tests contained in a specific .py file ::
nosetests <filename>.py theano-nose <filename>.py
Running a specific unit test :: Running a specific unit test ::
nosetests <filename>.py:<classname>.<method_name> theano-nose <filename>.py:<classname>.<method_name>
Using unittest module Using unittest module
~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
...@@ -304,9 +311,9 @@ type this: ...@@ -304,9 +311,9 @@ type this:
.. code-block:: bash .. code-block:: bash
THEANO_FLAGS='mode=FAST_COMPILE' nosetests THEANO_FLAGS='mode=FAST_COMPILE' theano-nose
THEANO_FLAGS='mode=FAST_RUN' nosetests THEANO_FLAGS='mode=FAST_RUN' theano-nose
THEANO_FLAGS='mode=DebugMode' nosetests THEANO_FLAGS='mode=DebugMode' theano-nose
.. _random_value_in_tests: .. _random_value_in_tests:
...@@ -346,7 +353,7 @@ The behaviour of seed_rng is as follows: ...@@ -346,7 +353,7 @@ The behaviour of seed_rng is as follows:
The main advantage of using unittest_tools.seed_rng is that it allows The main advantage of using unittest_tools.seed_rng is that it allows
us to change the seed used in the unitests, without having to manually us to change the seed used in the unitests, without having to manually
edit all the files. For example, this allows the nightly build to run edit all the files. For example, this allows the nightly build to run
nosetests repeatedly, changing the seed on every run (hence achieving theano-nose repeatedly, changing the seed on every run (hence achieving
a higher confidence that the variables are correct), while still a higher confidence that the variables are correct), while still
making sure unittests are deterministic. making sure unittests are deterministic.
......
...@@ -322,14 +322,18 @@ You can also run them in-place from the Git checkout directory by typing ...@@ -322,14 +322,18 @@ You can also run them in-place from the Git checkout directory by typing
.. code-block:: bash .. code-block:: bash
nosetests theano-nose
You should be able to execute it if you followed the instructions above.
If ``theano-nose`` is not found by your shell, you will need to add
``Theano/bin`` to your ``PATH`` environment variable.
.. note:: .. note::
The tests should be run with the configuration option :attr:`~config.device` The tests should be run with the configuration option :attr:`~config.device`
set to ``cpu`` (default). If you need to change this value, set to ``cpu`` (default). If you need to change this value,
you can do that by setting the :envvar:`THEANO_FLAGS` environment variable, you can do that by setting the :envvar:`THEANO_FLAGS` environment variable,
by prefixing the ``nosetests`` command with ``THEANO_FLAGS=device=cpu``. by prefixing the ``theano-nose`` command with ``THEANO_FLAGS=device=cpu``.
If you have a GPU, it will automatically be used to run GPU-related tests. If you have a GPU, it will automatically be used to run GPU-related tests.
If you want GPU-related tests to run on a specific GPU device, and not If you want GPU-related tests to run on a specific GPU device, and not
...@@ -339,9 +343,9 @@ You can also run them in-place from the Git checkout directory by typing ...@@ -339,9 +343,9 @@ You can also run them in-place from the Git checkout directory by typing
See :ref:`libdoc_config` for more information on how to change these See :ref:`libdoc_config` for more information on how to change these
configuration options. configuration options.
All tests should pass except those marked as ``KnownFailureTest``. If some All tests should pass (skipped tests and known failures are normal). If
test fails on your machine, you are encouraged to tell us what went wrong on some test fails on your machine, you are encouraged to tell us what went
the ``theano-users@googlegroups.com`` mailing list. wrong on the ``theano-users@googlegroups.com`` mailing list.
Troubleshooting: Make sure you have a BLAS library Troubleshooting: Make sure you have a BLAS library
...@@ -1003,14 +1007,14 @@ Testing your installation ...@@ -1003,14 +1007,14 @@ Testing your installation
~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
Currently, due to memory fragmentation issue in Windows, the Currently, due to memory fragmentation issue in Windows, the
test-suite breaks at some point when using ``nosetests``, with many error test-suite breaks at some point when using ``theano-nose``, with many error
messages looking messages looking
like: ``DLL load failed: Not enough storage is available to process this like: ``DLL load failed: Not enough storage is available to process this
command``. As a workaround, you can instead run: command``. As a workaround, you can instead run:
.. code-block:: bash .. code-block:: bash
python theano/tests/run_tests_in_batch.py theano-nose --batch
This will run tests in batches of 100, which should avoid memory errors. This will run tests in batches of 100, which should avoid memory errors.
Note that this script calls ``nosetests``, which may require being run from Note that this script calls ``nosetests``, which may require being run from
......
...@@ -126,7 +126,7 @@ be logged into ``ceylon``, Fred leaves a shell open for that.) ...@@ -126,7 +126,7 @@ be logged into ``ceylon``, Fred leaves a shell open for that.)
The cronjob executes the scripts The cronjob executes the scripts
``~/nightly_build/do_nightly_build_{theano,pylearn,deeplearning}``. ``~/nightly_build/do_nightly_build_{theano,pylearn,deeplearning}``.
These scripts perform an update of theano (and pylearn, and These scripts perform an update of theano (and pylearn, and
DeepLearningTutorials too), and execute nosetests (in various settings). DeepLearningTutorials too), and execute theano-nose (in various settings).
The output is emailed automatically to the `theano-buildbot`_ mailing list. The output is emailed automatically to the `theano-buildbot`_ mailing list.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论