[yt-svn] commit/yt: ngoldbaum: Merged in xarthisius/yt (pull request #2101)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Apr 6 11:21:59 PDT 2016


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/0157f4cbca3c/
Changeset:   0157f4cbca3c
Branch:      yt
User:        ngoldbaum
Date:        2016-04-06 18:21:45+00:00
Summary:     Merged in xarthisius/yt (pull request #2101)

Unify answer tests' yaml files
Affected #:  5 files

diff -r 47103efaf15acd4f13408b11f292e05e1cb4abcc -r 0157f4cbca3c05129132f83fb1a8ad9d61084b8d doc/source/developing/testing.rst
--- a/doc/source/developing/testing.rst
+++ b/doc/source/developing/testing.rst
@@ -485,12 +485,12 @@
 autodiscovered by `nose <http://nose.readthedocs.org/en/latest/>`_ itself,
 answer tests require definition of which set of tests constitute to a given
 answer. Configuration for the integration server is stored in
-*tests/tests_2.7.yaml* in the main yt repository:
+*tests/tests.yaml* in the main yt repository:
 
 .. code-block:: yaml
 
    answer_tests:
-      local_artio_270:
+      local_artio_000:
          - yt/frontends/artio/tests/test_outputs.py
    # ...
    other_tests:
@@ -498,7 +498,7 @@
          - '-v'
          - '-s'
 
-Each element under *answer_tests* defines answer name (*local_artio_270* in above
+Each element under *answer_tests* defines answer name (*local_artio_000* in above
 snippet) and specifies a list of files/classes/methods that will be validated
 (*yt/frontends/artio/tests/test_outputs.py* in above snippet). On the testing
 server it is translated to:
@@ -506,7 +506,7 @@
 .. code-block:: bash
 
    $ nosetests --with-answer-testing --local --local-dir ... --answer-big-data \
-      --answer-name=local_artio_270 \
+      --answer-name=local_artio_000 \
       yt/frontends/artio/tests/test_outputs.py
 
 If the answer doesn't exist on the server yet, ``nosetests`` is run twice and
@@ -516,21 +516,21 @@
 ~~~~~~~~~~~~~~~~
 
 In order to regenerate answers for a particular set of tests it is sufficient to
-change the answer name in *tests/tests_2.7.yaml* e.g.:
+change the answer name in *tests/tests.yaml* e.g.:
 
 .. code-block:: diff
 
-   --- a/tests/tests_2.7.yaml
-   +++ b/tests/tests_2.7.yaml
+   --- a/tests/tests.yaml
+   +++ b/tests/tests.yaml
    @@ -25,7 +25,7 @@
         - yt/analysis_modules/halo_finding/tests/test_rockstar.py
         - yt/frontends/owls_subfind/tests/test_outputs.py
 
-   -  local_owls_270:
-   +  local_owls_271:
+   -  local_owls_000:
+   +  local_owls_001:
         - yt/frontends/owls/tests/test_outputs.py
 
-      local_pw_270:
+      local_pw_000:
 
 would regenerate answers for OWLS frontend.
 
@@ -538,20 +538,35 @@
 ~~~~~~~~~~~~~~~~~~~~~~~
 
 In order to add a new set of answer tests, it is sufficient to extend the
-*answer_tests* list in *tests/tests_2.7.yaml* e.g.:
+*answer_tests* list in *tests/tests.yaml* e.g.:
 
 .. code-block:: diff
 
-   --- a/tests/tests_2.7.yaml
-   +++ b/tests/tests_2.7.yaml
+   --- a/tests/tests.yaml
+   +++ b/tests/tests.yaml
    @@ -60,6 +60,10 @@
         - yt/analysis_modules/absorption_spectrum/tests/test_absorption_spectrum.py:test_absorption_spectrum_non_cosmo
         - yt/analysis_modules/absorption_spectrum/tests/test_absorption_spectrum.py:test_absorption_spectrum_cosmo
 
-   +  local_gdf_270:
+   +  local_gdf_000:
    +    - yt/frontends/gdf/tests/test_outputs.py
    +
    +
     other_tests:
       unittests:
 
+Restricting Python Versions for Answer Tests
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If for some reason a test can be run only for a specific version of python it is
+possible to indicate this by adding a ``[py2]`` or ``[py3]`` tag. For example:
+
+.. code-block:: yaml
+
+   answer_tests:
+      local_test_000:
+         - yt/test_A.py  # [py2]
+         - yt/test_B.py  # [py3]
+
+would result in ``test_A.py`` being run only for *python2* and ``test_B.py``
+being run only for *python3*.

diff -r 47103efaf15acd4f13408b11f292e05e1cb4abcc -r 0157f4cbca3c05129132f83fb1a8ad9d61084b8d tests/nose_runner.py
--- a/tests/nose_runner.py
+++ b/tests/nose_runner.py
@@ -7,7 +7,6 @@
 from yt.config import ytcfg
 from yt.utilities.answer_testing.framework import AnswerTesting
 
-
 class NoseWorker(multiprocessing.Process):
 
     def __init__(self, task_queue, result_queue):
@@ -54,10 +53,19 @@
 
 
 def generate_tasks_input():
+    pyver = "py{}{}".format(sys.version_info.major, sys.version_info.minor)
+    if sys.version_info < (3, 0, 0):
+        DROP_TAG = "py3"
+    else:
+        DROP_TAG = "py2"
+
     test_dir = ytcfg.get("yt", "test_data_dir")
     answers_dir = os.path.join(test_dir, "answers")
-    with open('tests/tests_%i.%i.yaml' % sys.version_info[:2], 'r') as obj:
-        tests = yaml.load(obj)
+    with open('tests/tests.yaml', 'r') as obj:
+        lines = obj.read()
+    data = '\n'.join([line for line in lines.split('\n')
+                      if DROP_TAG not in line])
+    tests = yaml.load(data)
 
     base_argv = ['--local-dir=%s' % answers_dir, '-v',
                  '--with-answer-testing', '--answer-big-data', '--local']
@@ -66,9 +74,11 @@
     for test in list(tests["other_tests"].keys()):
         args.append([test] + tests["other_tests"][test])
     for answer in list(tests["answer_tests"].keys()):
-        argv = [answer]
+        if tests["answer_tests"][answer] is None:
+            continue
+        argv = ["{}_{}".format(pyver, answer)]
         argv += base_argv
-        argv.append('--answer-name=%s' % answer)
+        argv.append('--answer-name=%s' % argv[0])
         argv += tests["answer_tests"][answer]
         args.append(argv)
 

diff -r 47103efaf15acd4f13408b11f292e05e1cb4abcc -r 0157f4cbca3c05129132f83fb1a8ad9d61084b8d tests/tests.yaml
--- /dev/null
+++ b/tests/tests.yaml
@@ -0,0 +1,73 @@
+answer_tests:
+  local_artio_000:
+    - yt/frontends/artio/tests/test_outputs.py
+
+  local_athena_000:
+    - yt/frontends/athena
+
+  local_chombo_000:
+    - yt/frontends/chombo/tests/test_outputs.py
+
+  local_enzo_000:
+    - yt/frontends/enzo
+
+  local_fits_000:
+    - yt/frontends/fits/tests/test_outputs.py
+
+  local_flash_000:
+    - yt/frontends/flash/tests/test_outputs.py
+
+  local_gadget_000:
+    - yt/frontends/gadget/tests/test_outputs.py
+
+  local_gdf_000:
+    - yt/frontends/gdf/tests/test_outputs.py
+
+  local_halos_000:
+    - yt/analysis_modules/halo_analysis/tests/test_halo_finders.py  # [py2]
+    - yt/analysis_modules/halo_finding/tests/test_rockstar.py  # [py2]
+    - yt/frontends/owls_subfind/tests/test_outputs.py
+    - yt/frontends/gadget_fof/tests/test_outputs.py:test_fields_g5
+    - yt/frontends/gadget_fof/tests/test_outputs.py:test_fields_g42
+  
+  local_owls_000:
+    - yt/frontends/owls/tests/test_outputs.py
+  
+  local_pw_000:
+    - yt/visualization/tests/test_plotwindow.py:test_attributes
+    - yt/visualization/tests/test_plotwindow.py:test_attributes_wt
+    - yt/visualization/tests/test_profile_plots.py:test_phase_plot_attributes
+    - yt/visualization/tests/test_particle_plot.py:test_particle_projection_answers
+    - yt/visualization/tests/test_particle_plot.py:test_particle_projection_filter
+    - yt/visualization/tests/test_particle_plot.py:test_particle_phase_answers
+  
+  local_tipsy_000:
+    - yt/frontends/tipsy/tests/test_outputs.py
+  
+  local_varia_000:
+    - yt/analysis_modules/radmc3d_export
+    - yt/frontends/moab/tests/test_c5.py
+    - yt/analysis_modules/photon_simulator/tests/test_spectra.py
+    - yt/analysis_modules/photon_simulator/tests/test_sloshing.py
+    - yt/visualization/volume_rendering/tests/test_vr_orientation.py
+    - yt/visualization/volume_rendering/tests/test_mesh_render.py
+
+  local_orion_000:
+    - yt/frontends/boxlib/tests/test_orion.py
+  
+  local_ramses_000:
+    - yt/frontends/ramses/tests/test_outputs.py
+  
+  local_ytdata_000:
+    - yt/frontends/ytdata
+
+  local_absorption_spectrum_000:
+    - yt/analysis_modules/absorption_spectrum/tests/test_absorption_spectrum.py:test_absorption_spectrum_non_cosmo
+    - yt/analysis_modules/absorption_spectrum/tests/test_absorption_spectrum.py:test_absorption_spectrum_cosmo
+
+other_tests:
+  unittests:
+     - '-v'
+  cookbook:
+     - '-v'
+     - 'doc/source/cookbook/tests/test_cookbook.py'

diff -r 47103efaf15acd4f13408b11f292e05e1cb4abcc -r 0157f4cbca3c05129132f83fb1a8ad9d61084b8d tests/tests_2.7.yaml
--- a/tests/tests_2.7.yaml
+++ /dev/null
@@ -1,71 +0,0 @@
-answer_tests:
-  local_artio_270:
-    - yt/frontends/artio/tests/test_outputs.py
-
-  local_athena_270:
-    - yt/frontends/athena
-
-  local_chombo_271:
-    - yt/frontends/chombo/tests/test_outputs.py
-
-  local_enzo_270:
-    - yt/frontends/enzo
-
-  local_fits_270:
-    - yt/frontends/fits/tests/test_outputs.py
-
-  local_flash_270:
-    - yt/frontends/flash/tests/test_outputs.py
-
-  local_gadget_270:
-    - yt/frontends/gadget/tests/test_outputs.py
-
-  local_gdf_270:
-    - yt/frontends/gdf/tests/test_outputs.py
-
-  local_halos_270:
-    - yt/analysis_modules/halo_analysis/tests/test_halo_finders.py
-    - yt/analysis_modules/halo_finding/tests/test_rockstar.py
-    - yt/frontends/owls_subfind/tests/test_outputs.py
-  
-  local_owls_270:
-    - yt/frontends/owls/tests/test_outputs.py
-  
-  local_pw_271:
-    - yt/visualization/tests/test_plotwindow.py:test_attributes
-    - yt/visualization/tests/test_plotwindow.py:test_attributes_wt
-    - yt/visualization/tests/test_profile_plots.py:test_phase_plot_attributes
-    - yt/visualization/tests/test_particle_plot.py:test_particle_projection_answers
-    - yt/visualization/tests/test_particle_plot.py:test_particle_projection_filter
-    - yt/visualization/tests/test_particle_plot.py:test_particle_phase_answers
-  
-  local_tipsy_270:
-    - yt/frontends/tipsy/tests/test_outputs.py
-  
-  local_varia_274:
-    - yt/analysis_modules/radmc3d_export
-    - yt/frontends/moab/tests/test_c5.py
-    - yt/analysis_modules/photon_simulator/tests/test_spectra.py
-    - yt/analysis_modules/photon_simulator/tests/test_sloshing.py
-    - yt/visualization/volume_rendering/tests/test_vr_orientation.py
-    - yt/visualization/volume_rendering/tests/test_mesh_render.py
-
-  local_orion_270:
-    - yt/frontends/boxlib/tests/test_orion.py
-  
-  local_ramses_270:
-    - yt/frontends/ramses/tests/test_outputs.py
-  
-  local_ytdata_270:
-    - yt/frontends/ytdata
-
-  local_absorption_spectrum_271:
-    - yt/analysis_modules/absorption_spectrum/tests/test_absorption_spectrum.py:test_absorption_spectrum_non_cosmo
-    - yt/analysis_modules/absorption_spectrum/tests/test_absorption_spectrum.py:test_absorption_spectrum_cosmo
-
-other_tests:
-  unittests:
-     - '-v'
-  cookbook:
-     - '-v'
-     - 'doc/source/cookbook/tests/test_cookbook.py'

diff -r 47103efaf15acd4f13408b11f292e05e1cb4abcc -r 0157f4cbca3c05129132f83fb1a8ad9d61084b8d tests/tests_3.5.yaml
--- a/tests/tests_3.5.yaml
+++ /dev/null
@@ -1,71 +0,0 @@
-answer_tests:
-  local_artio_350:
-    - yt/frontends/artio/tests/test_outputs.py
-
-  local_athena_350:
-    - yt/frontends/athena
-
-  local_chombo_350:
-    - yt/frontends/chombo/tests/test_outputs.py
-
-  local_enzo_350:
-    - yt/frontends/enzo
-
-  local_fits_350:
-    - yt/frontends/fits/tests/test_outputs.py
-
-  local_flash_350:
-    - yt/frontends/flash/tests/test_outputs.py
-
-  local_gadget_350:
-    - yt/frontends/gadget/tests/test_outputs.py
-
-  local_gdf_350:
-    - yt/frontends/gdf/tests/test_outputs.py
-
-  local_halos_350:
-    - yt/frontends/owls_subfind/tests/test_outputs.py
-    - yt/frontends/gadget_fof/tests/test_outputs.py:test_fields_g5
-    - yt/frontends/gadget_fof/tests/test_outputs.py:test_fields_g42
-  
-  local_owls_350:
-    - yt/frontends/owls/tests/test_outputs.py
-  
-  local_pw_350:
-    - yt/visualization/tests/test_plotwindow.py:test_attributes
-    - yt/visualization/tests/test_plotwindow.py:test_attributes_wt
-    - yt/visualization/tests/test_profile_plots.py:test_phase_plot_attributes
-    - yt/visualization/tests/test_particle_plot.py:test_particle_projection_answers
-    - yt/visualization/tests/test_particle_plot.py:test_particle_projection_filter
-    - yt/visualization/tests/test_particle_plot.py:test_particle_phase_answers
-  
-  local_tipsy_350:
-    - yt/frontends/tipsy/tests/test_outputs.py
-  
-  local_varia_351:
-    - yt/analysis_modules/radmc3d_export
-    - yt/frontends/moab/tests/test_c5.py
-    - yt/analysis_modules/photon_simulator/tests/test_spectra.py
-    - yt/analysis_modules/photon_simulator/tests/test_sloshing.py
-    - yt/visualization/volume_rendering/tests/test_vr_orientation.py
-    - yt/visualization/volume_rendering/tests/test_mesh_render.py
-
-  local_orion_350:
-    - yt/frontends/boxlib/tests/test_orion.py
-  
-  local_ramses_350:
-    - yt/frontends/ramses/tests/test_outputs.py
-  
-  local_ytdata_350:
-    - yt/frontends/ytdata
-
-  local_absorption_spectrum_350:
-    - yt/analysis_modules/absorption_spectrum/tests/test_absorption_spectrum.py:test_absorption_spectrum_non_cosmo
-    - yt/analysis_modules/absorption_spectrum/tests/test_absorption_spectrum.py:test_absorption_spectrum_cosmo
-
-other_tests:
-  unittests:
-     - '-v'
-  cookbook:
-     - '-v'
-     - 'doc/source/cookbook/tests/test_cookbook.py'

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-svn-spacepope.org/attachments/20160406/ddde4cbd/attachment-0001.htm>


More information about the yt-svn mailing list