Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-9082

import ROOT and pytest collecting tests

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • High
    • Resolution: Fixed
    • 6.10/06, 6.10/08
    • 6.12/00, 6.10/08
    • PyROOT
    • None
    • ROOT 6.10/06, 6.10/08

      pytest 3.2.3

      ipython 5.5.0

       

    Description

      Hello,

      if I put simple file pok.py:

      import ROOT
      print ROOT.gSystem

      somewhere in my package (with a lot of sub-directories and modules), then I get this error running pytest for the whole package (running "pytest pok.py" is fine)

      pok.py:2: in <module>
       print ROOT.gSystem
      ../../opt/root-v6-10-08/lib/ROOT.py:421: in __getattr1
       self.__finalSetup()
      ../../opt/root-v6-10-08/lib/ROOT.py:563: in __finalSetup
       get_ipython().run_line_magic('gui', 'ROOT')
      E AttributeError: 'NoneType' object has no attribute 'run_line_magic'

      It is happening during pytest collecting tests. I have ipython installed, but  why  it is causing a problem during collecting tests? get_ipython() can't find it?

       

      This works fine:

      --> python pok.py
      <ROOT.TUnixSystem object ("Unix") at 0x837fb0>

       

      Without the pok.py file I obtain an error during collecting tests (from the whole package) related to importing something from ROOT (e.g., ROOT.gSystem).

      Downgrading version of pytest and/or ipython does not help. I can't localize the problem better at the moment.

      With ROOT v6-08-06 there was no problem. I thing that for this reason I could not update also to ROOT 6.09.

       

      Any idea?

       

      Thanks,

      Jiri

       

       

       

       

      Attachments

        Activity

          People

            mato Pere Mato Vila
            jprochaz Jiri Prochazka
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: