Skip to content

Commit

Permalink
Drop comments for running tests with nose
Browse files Browse the repository at this point in the history
Fix Install docs

Update CHANGELOG
  • Loading branch information
utkbansal committed Jul 16, 2017
1 parent 16eae41 commit a89b59d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 73 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ examples/output.txt
.eggs
# ignore Vagrant virtual machines
.vagrant
# ignore nosetest/coverage files
# ignore coverage files
.coverage
.noseids
# ignore trajectory offset caches
Expand Down
35 changes: 3 additions & 32 deletions package/MDAnalysis/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,33 +39,6 @@
>>> import MDAnalysis.tests
>>> MDAnalysis.tests.test()
Some tests can take a few seconds; in order to skip the slow tests run
>>> MDAnalysis.tests.test(label='fast')
Additional information is displayed at a higher verbosity level (the default is
1):
>>> MDAnalysis.tests.test(label='fast', argv=['--verbosity=3'])
Note that if no tests are being run then one might have to run the
tests with the ``--exe`` flag
>>> MDAnalysis.tests.test(label='fast', argv=['--exe'])
(This happens when python files are installed with the executable bit set. By
default the nose_ testing framework refuses to use those files and must be
encouraged to do so with the ``--exe`` switch.)
See `nose commandline options`_ for additional options that can be used.
For the particular case of code coverage MDAnalysis mustn't be imported prior
to testing, and testing must be invoked directly from `:meth:MDAnalysisTests.run`:
>>> import MDAnalysisTests
>>> MDAnalysisTests.run(argv=['--exe', '--with-coverage', '--cover-package=MDAnalysis'])
Data
====
Expand All @@ -92,16 +65,14 @@
Writing test cases
==================
The unittests use the :mod:`unittest` module together with nose_. See the
The unittests use the :mod:`pytest_` module. See the
examples provided alongside the ``MDAnalysisTests`` module.
The `SciPy testing guidelines`_ are also a good howto for writing test cases.
.. _nose:
http://somethingaboutorange.com/mrl/projects/nose/0.11.3/index.html
.. _nose commandline options:
http://somethingaboutorange.com/mrl/projects/nose/0.11.3/usage.html#extended-usage
.. _pytest:
https://docs.pytest.org/en/latest/
.. _SciPy testing guidelines:
http://projects.scipy.org/numpy/wiki/TestingGuidelines#id11
.. _Charmm: http://www.charmm.org
Expand Down
3 changes: 2 additions & 1 deletion testsuite/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ and https://github.com/MDAnalysis/mdanalysis/wiki/UnitTests
------------------------------------------------------------------------------
mm/dd/yy

* 0.16.2
* 0.16.2 utkbansal
- Port to pytest - removed nose as a dependency (Issue #884)

06/03/17 xiki_tempula

Expand Down
4 changes: 2 additions & 2 deletions testsuite/INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ From sources

From the top directory of the checked out sources:

./testsuite/MDAnalysisTests/mda_nosetests --exe -v --processes=4 --process-timeout=120
pytest /testsuite/MDAnalysisTests/ -n=3

(use --processes=4 if you have 4 cores available to run in parallel or
(use --n=4 if you have 4 cores available to run in parallel or
adapt to available cores.)


Expand Down
38 changes: 3 additions & 35 deletions testsuite/MDAnalysisTests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,8 @@
Run all the tests with
>>> import MDAnalysisTests.tests
>>> MDAnalysisTests.tests.test(label='full')
Some tests can take a few seconds; in order to skip the slow tests run
>>> MDAnalysisTests.tests.test(label='fast')
Additional information is displayed at a higher verbosity level (the default is
1):
>>> MDAnalysisTests.tests.test(label='fast', verbose=3)
Note that if no tests are being run then one might have to run the
tests with the ``--exe`` flag
>>> MDAnalysisTests.tests.test(label='fast', extra_argv=['--exe'])
(This happens when python files are installed with the executable bit set. By
default the nose_ testing framework refuses to use those files and must be
encouraged to do so with the ``--exe`` switch.)
See `nose commandline options`_ for additional options that can be used; for
instance, code coverage can also be checked:
>>> MDAnalysisTests.tests.test(label='full', extra_argv=['--exe', '--with-coverage'])
>>> from MDAnalysisTests import run
>>> run()
Data
Expand Down Expand Up @@ -90,22 +67,13 @@
Writing test cases
==================
The unittests use the :mod:`unittest` module together with nose_. See the
The unittests use the :mod:`pytest` module. See the
examples in the ``MDAnalysisTests`` directory.
The `SciPy testing guidelines`_ are a good howto for writing test cases,
especially as we are directly using this framework (imported from numpy).
A number of plugins external to nose are automatically loaded. The `knownfailure`
plugin provides the `@knownfailure()` decorator, which can be used to mark tests
that are expected to fail. If used with default arguments the parentheses can be
excluded.
.. _NumPy: http://www.numpy.org/
.. _nose:
http://nose.readthedocs.org/en/latest/
.. _nose commandline options:
http://nose.readthedocs.org/en/latest/man.html?highlight=command%20line
.. _SciPy testing guidelines:
http://projects.scipy.org/numpy/wiki/TestingGuidelines#id11
.. _Charmm: http://www.charmm.org
Expand Down
3 changes: 1 addition & 2 deletions testsuite/MDAnalysisTests/topology/test_tprparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ class TPRBase(TPRAttrs):
expected_n_segments = 2


# All these classes should be generated in a loop. Yet, nose test generation
# seems to work only with functions, and not with classes.
# All these classes should be generated in a loop.
class TestTPR400(TPRBase):

__test__ = True
Expand Down

0 comments on commit a89b59d

Please sign in to comment.