Uploaded image for project: 'DRP 1D pipeline'
  1. DRP 1D pipeline
  2. PIPE1D-11

pytest failed for release 0.12.0

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done (View Workflow)
    • Priority: Normal
    • Resolution: Done
    • Component/s: None
    • Labels:
      None

      Description

      I'm trying to install the latest version on a debian server. drp_1d seems to be OK with the test passed, but I got failures below during the pytest process for drp_1dpipe. This might happen in the older version, but I don't remember what was wrong. 

       

      ============================================================================================= test session starts =============================================================================================
      platform linux – Python 3.5.3, pytest-4.0.1, py-1.8.0, pluggy-0.12.0
      rootdir: /home/pfs/src/drp_1dpipe, inifile:
      collected 8 items

      drp_1dpipe/tests/test_io.py . [ 12%]
      drp_1dpipe/tests/test_merge_results.py . [ 25%]
      drp_1dpipe/tests/test_pre_process.py F. [ 50%]
      drp_1dpipe/tests/test_utils.py ..F. [100%]

      ================================================================================================== FAILURES ===================================================================================================
      __________________________________________________________________________________________________ test_run ___________________________________________________________________________________________________

      def test_run():
      """
      The "test_run" function.

      This function test the "run" function of "pre_process.py" module.
      """

      workdir = TemporaryDirectory()
      args = FakeArgs(workdir.name)

      fits_file = []
      for i in range(9):
      with open(normpath(args.spectra_path, '{}.fits'.format), 'w') as f:
      fits_file.append(os.path.basename(f.name))

      > result_run = run(args)

      drp_1dpipe/tests/test_pre_process.py:61:
      _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

      args = <drp_1dpipe.tests.test_pre_process.FakeArgs object at 0x7f278421c2b0>

      def run(args):
      """
      Prepare workdir for process_spectra.

      This function creates a json file containing a list of list of spectra.

      :param args: parsed arguments of the program.
      :return: 0 on success
      """

      1. initialize logger
        init_logger("pre_process", args.logdir, args.loglevel)

      > spectra_dir = normpath(args.workdir, args.spectra_dir)
      E AttributeError: 'FakeArgs' object has no attribute 'spectra_dir'

      drp_1dpipe/pre_process/pre_process.py:67: AttributeError
      _____________________________________________________________________________________________ test_args_from_file _____________________________________________________________________________________________

      def test_args_from_file():
      """
      The "test_args_from_file" function.

      This function tests feature of retrieving argument value from
      configuration file
      """
      fp1 = tempfile.NamedTemporaryFile()
      conf_file = fp1.name
      with open(conf_file, 'w') as cf:
      cf.write('arg1 = 4\n')
      cf.write('arg2 = foo2 foo2\n')
      cf.write('arg3 = foo3 # test\n')
      cf.write('arg4 = # foo4\n')
      cf.write('arg5 # = foo5\n')
      cf.write('#arg6 = foo6')
      cf.write('arg7 arg7 = foo7\n')

      class MyCls():
      arg1 = "2"

      args = MyCls()
      > get_args_from_file(conf_file, args)
      E TypeError: get_args_from_file() takes 1 positional argument but 2 were given

      drp_1dpipe/tests/test_utils.py:59: TypeError
      ============================================================================================== warnings summary ===============================================================================================
      /home/pfs/.local/lib/python3.5/site-packages/pyfits/_init_.py:22
      /home/pfs/.local/lib/python3.5/site-packages/pyfits/_init_.py:22: PyFITSDeprecationWarning: PyFITS is deprecated, please use astropy.io.fits
      PyFITSDeprecationWarning) # noqa

      – Docs: https://docs.pytest.org/en/latest/warnings.html
      =============================================================================== 2 failed, 6 passed, 1 warnings in 0.55 seconds ================================================================================

        Attachments

          Activity

            People

            • Assignee:
              pychabau Pierre-Yves CHABAUD
              Reporter:
              kiyoto.yabe Kiyoto Yabe
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: