Testing testpyomdrifthist ... FAILED
Message: will run ./testpyomdrifthist for no longer than 600 seconds.
============================= test session starts ==============================
platform linux -- Python 3.12.4, pytest-9.0.3, pluggy-1.6.0 -- /sasbuild/tools/python-3.12.4/bin/python3
cachedir: .pytest_cache
rootdir: /harness/packages/pyomdrifthist
plugins: anyio-4.13.0
collecting ... collected 8 items

pyomdrifthist_test.py::test_euclid_modulus PASSED                        [ 12%]
pyomdrifthist_test.py::test_get_platescale FAILED                        [ 25%]
pyomdrifthist_test.py::test_get_more_recent_ccf FAILED                   [ 37%]
pyomdrifthist_test.py::test_evaluate_zerodrift PASSED                    [ 50%]
pyomdrifthist_test.py::test_general_png FAILED                           [ 62%]
pyomdrifthist_test.py::test_general_pdf FAILED                           [ 75%]
pyomdrifthist_test.py::test_general1pdf FAILED                           [ 87%]
pyomdrifthist_test.py::test_general2pdf FAILED                           [100%]

=================================== FAILURES ===================================
_____________________________ test_get_platescale ______________________________

    def test_get_platescale():
>       pltscl = pyomdrifthist.get_platescale('U')
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

pyomdrifthist_test.py:32: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py:167: in get_platescale
    latest_ccf = get_more_recent_ccf(om_ccf_list)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

abspaths = []

    def get_more_recent_ccf(abspaths):
        """
        Returns the absolute path of the most recent CCF file.
    
        Args:
            abspaths: the absolute path of the files to evaluate.
    
        Output:
            the absolute path of the most recent file.
        """
    
        maxn = 0
        for f in abspaths:
            f_aux = os.path.basename(f)
            num = int(re.search(r'\d+', f_aux).group(0))
            if num > maxn:
                maxn = num
                maxf = f
    
>       return maxf
               ^^^^
E       UnboundLocalError: cannot access local variable 'maxf' where it is not associated with a value

/harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py:125: UnboundLocalError
------------------------------ Captured log call -------------------------------
DEBUG    omdrifthist:logger.py:158 Looking for platescale...
DEBUG    omdrifthist:logger.py:158 List of folders found in CCF path: ['/ccf/pub', '/ccf/priv/rt', '/ccf/priv/validation', '/harness/lib/testccf']
DEBUG    omdrifthist:logger.py:158 /ccf/pub does not contain OM astronometry calibration file.
DEBUG    omdrifthist:logger.py:158 /ccf/priv/rt does not contain OM astronometry calibration file.
DEBUG    omdrifthist:logger.py:158 /ccf/priv/validation does not contain OM astronometry calibration file.
DEBUG    omdrifthist:logger.py:158 /harness/lib/testccf does not contain OM astronometry calibration file.
DEBUG    omdrifthist:logger.py:158 Found the following OM CCF compatible files: []
___________________________ test_get_more_recent_ccf ___________________________

    def test_get_more_recent_ccf():
        list_ccf = os.environ['SAS_CCFPATH']
        list_ccf = list_ccf + ':/ccf/valid'
        folders = list_ccf.split(':')
        om_ccf_list = []
        for folder in folders:
            try:
                om_ccf_file = os.path.abspath(glob.glob(folder + '/OM_ASTR*')[0])
            except IndexError:
                continue
            om_ccf_list.append(om_ccf_file)
>       latest_ccf = pyomdrifthist.get_more_recent_ccf(om_ccf_list)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

pyomdrifthist_test.py:47: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

abspaths = []

    def get_more_recent_ccf(abspaths):
        """
        Returns the absolute path of the most recent CCF file.
    
        Args:
            abspaths: the absolute path of the files to evaluate.
    
        Output:
            the absolute path of the most recent file.
        """
    
        maxn = 0
        for f in abspaths:
            f_aux = os.path.basename(f)
            num = int(re.search(r'\d+', f_aux).group(0))
            if num > maxn:
                maxn = num
                maxf = f
    
>       return maxf
               ^^^^
E       UnboundLocalError: cannot access local variable 'maxf' where it is not associated with a value

/harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py:125: UnboundLocalError
_______________________________ test_general_png _______________________________

    def test_general_png():
        dict_values = dict()
        dict_values.update({'set' : 'test_omdrift.fits'})
        dict_values.update({'pages' : '1,2'})
        dict_values.update({'plotfile' : 'test_plot.PNG'})
        dict_values.update({'nbins' : 50})
        dict_values.update({'trackradius' : 0.5})
>       pyomdrifthist.run(dict_values)

pyomdrifthist_test.py:65: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py:526: in run
    platescale = get_platescale(filt)
                 ^^^^^^^^^^^^^^^^^^^^
/harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py:167: in get_platescale
    latest_ccf = get_more_recent_ccf(om_ccf_list)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

abspaths = []

    def get_more_recent_ccf(abspaths):
        """
        Returns the absolute path of the most recent CCF file.
    
        Args:
            abspaths: the absolute path of the files to evaluate.
    
        Output:
            the absolute path of the most recent file.
        """
    
        maxn = 0
        for f in abspaths:
            f_aux = os.path.basename(f)
            num = int(re.search(r'\d+', f_aux).group(0))
            if num > maxn:
                maxn = num
                maxf = f
    
>       return maxf
               ^^^^
E       UnboundLocalError: cannot access local variable 'maxf' where it is not associated with a value

/harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py:125: UnboundLocalError
----------------------------- Captured stderr call -----------------------------
omdrifthist - WARNING - Executing /harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py {'set': 'test_omdrift.fits', 'pages': '1,2', 'plotfile': 'test_plot.PNG', 'nbins': 50, 'trackradius': 0.5}
------------------------------ Captured log call -------------------------------
WARNING  omdrifthist:logger.py:158 Executing /harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py {'set': 'test_omdrift.fits', 'pages': '1,2', 'plotfile': 'test_plot.PNG', 'nbins': 50, 'trackradius': 0.5}
DEBUG    omdrifthist:logger.py:158 Using /harness/packages/pyomdrifthist/test/test_plot.PNG
DEBUG    omdrifthist:logger.py:158 Working with /harness/packages/pyomdrifthist/test/test_plot.PNG
DEBUG    omdrifthist:logger.py:158 Looking for platescale...
DEBUG    omdrifthist:logger.py:158 List of folders found in CCF path: ['/ccf/pub', '/ccf/priv/rt', '/ccf/priv/validation', '/harness/lib/testccf']
DEBUG    omdrifthist:logger.py:158 /ccf/pub does not contain OM astronometry calibration file.
DEBUG    omdrifthist:logger.py:158 /ccf/priv/rt does not contain OM astronometry calibration file.
DEBUG    omdrifthist:logger.py:158 /ccf/priv/validation does not contain OM astronometry calibration file.
DEBUG    omdrifthist:logger.py:158 /harness/lib/testccf does not contain OM astronometry calibration file.
DEBUG    omdrifthist:logger.py:158 Found the following OM CCF compatible files: []
_______________________________ test_general_pdf _______________________________

    def test_general_pdf():
        dict_values = dict()
        dict_values.update({'set' : 'test_omdrift.fits'})
        dict_values.update({'pages' : '1,2'})
        dict_values.update({'plotfile' : './more/plot1.PDF'})
        dict_values.update({'nbins' : 50})
        dict_values.update({'trackradius' : 0.5})
>       pyomdrifthist.run(dict_values)

pyomdrifthist_test.py:75: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py:526: in run
    platescale = get_platescale(filt)
                 ^^^^^^^^^^^^^^^^^^^^
/harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py:167: in get_platescale
    latest_ccf = get_more_recent_ccf(om_ccf_list)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

abspaths = []

    def get_more_recent_ccf(abspaths):
        """
        Returns the absolute path of the most recent CCF file.
    
        Args:
            abspaths: the absolute path of the files to evaluate.
    
        Output:
            the absolute path of the most recent file.
        """
    
        maxn = 0
        for f in abspaths:
            f_aux = os.path.basename(f)
            num = int(re.search(r'\d+', f_aux).group(0))
            if num > maxn:
                maxn = num
                maxf = f
    
>       return maxf
               ^^^^
E       UnboundLocalError: cannot access local variable 'maxf' where it is not associated with a value

/harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py:125: UnboundLocalError
----------------------------- Captured stderr call -----------------------------
omdrifthist - WARNING - Executing /harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py {'set': 'test_omdrift.fits', 'pages': '1,2', 'plotfile': './more/plot1.PDF', 'nbins': 50, 'trackradius': 0.5}
------------------------------ Captured log call -------------------------------
WARNING  omdrifthist:logger.py:158 Executing /harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py {'set': 'test_omdrift.fits', 'pages': '1,2', 'plotfile': './more/plot1.PDF', 'nbins': 50, 'trackradius': 0.5}
DEBUG    omdrifthist:logger.py:158 Using /harness/packages/pyomdrifthist/test/more/plot1.PDF
DEBUG    omdrifthist:logger.py:158 Working with /harness/packages/pyomdrifthist/test/more/plot1.PDF
DEBUG    omdrifthist:logger.py:158 Looking for platescale...
DEBUG    omdrifthist:logger.py:158 List of folders found in CCF path: ['/ccf/pub', '/ccf/priv/rt', '/ccf/priv/validation', '/harness/lib/testccf']
DEBUG    omdrifthist:logger.py:158 /ccf/pub does not contain OM astronometry calibration file.
DEBUG    omdrifthist:logger.py:158 /ccf/priv/rt does not contain OM astronometry calibration file.
DEBUG    omdrifthist:logger.py:158 /ccf/priv/validation does not contain OM astronometry calibration file.
DEBUG    omdrifthist:logger.py:158 /harness/lib/testccf does not contain OM astronometry calibration file.
DEBUG    omdrifthist:logger.py:158 Found the following OM CCF compatible files: []
_______________________________ test_general1pdf _______________________________

    def test_general1pdf():
        dict_values = dict()
        dict_values.update({'set' : 'test_omdrift.fits'})
        dict_values.update({'pages' : '1'})
        dict_values.update({'plotfile' : 'test_plot1'})
        dict_values.update({'nbins' : 50})
        dict_values.update({'trackradius' : 0.5})
>       pyomdrifthist.run(dict_values)

pyomdrifthist_test.py:85: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py:526: in run
    platescale = get_platescale(filt)
                 ^^^^^^^^^^^^^^^^^^^^
/harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py:167: in get_platescale
    latest_ccf = get_more_recent_ccf(om_ccf_list)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

abspaths = []

    def get_more_recent_ccf(abspaths):
        """
        Returns the absolute path of the most recent CCF file.
    
        Args:
            abspaths: the absolute path of the files to evaluate.
    
        Output:
            the absolute path of the most recent file.
        """
    
        maxn = 0
        for f in abspaths:
            f_aux = os.path.basename(f)
            num = int(re.search(r'\d+', f_aux).group(0))
            if num > maxn:
                maxn = num
                maxf = f
    
>       return maxf
               ^^^^
E       UnboundLocalError: cannot access local variable 'maxf' where it is not associated with a value

/harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py:125: UnboundLocalError
----------------------------- Captured stderr call -----------------------------
omdrifthist - WARNING - Executing /harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py {'set': 'test_omdrift.fits', 'pages': '1', 'plotfile': 'test_plot1', 'nbins': 50, 'trackradius': 0.5}
omdrifthist - WARNING - Format not found in the plotfile parameter. Using /harness/packages/pyomdrifthist/test/test_plot1.pdf as default.
------------------------------ Captured log call -------------------------------
WARNING  omdrifthist:logger.py:158 Executing /harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py {'set': 'test_omdrift.fits', 'pages': '1', 'plotfile': 'test_plot1', 'nbins': 50, 'trackradius': 0.5}
WARNING  omdrifthist:logger.py:158 Format not found in the plotfile parameter. Using /harness/packages/pyomdrifthist/test/test_plot1.pdf as default.
DEBUG    omdrifthist:logger.py:158 Working with /harness/packages/pyomdrifthist/test/test_plot1.pdf
DEBUG    omdrifthist:logger.py:158 Looking for platescale...
DEBUG    omdrifthist:logger.py:158 List of folders found in CCF path: ['/ccf/pub', '/ccf/priv/rt', '/ccf/priv/validation', '/harness/lib/testccf']
DEBUG    omdrifthist:logger.py:158 /ccf/pub does not contain OM astronometry calibration file.
DEBUG    omdrifthist:logger.py:158 /ccf/priv/rt does not contain OM astronometry calibration file.
DEBUG    omdrifthist:logger.py:158 /ccf/priv/validation does not contain OM astronometry calibration file.
DEBUG    omdrifthist:logger.py:158 /harness/lib/testccf does not contain OM astronometry calibration file.
DEBUG    omdrifthist:logger.py:158 Found the following OM CCF compatible files: []
_______________________________ test_general2pdf _______________________________

    def test_general2pdf():
        dict_values = dict()
        dict_values.update({'set' : 'test_omdrift.fits'})
        dict_values.update({'pages' : '2'})
        dict_values.update({'plotfile' : './test_plot2'})
        dict_values.update({'nbins' : 50})
        dict_values.update({'trackradius' : 0.5})
>       pyomdrifthist.run(dict_values)

pyomdrifthist_test.py:95: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py:526: in run
    platescale = get_platescale(filt)
                 ^^^^^^^^^^^^^^^^^^^^
/harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py:167: in get_platescale
    latest_ccf = get_more_recent_ccf(om_ccf_list)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

abspaths = []

    def get_more_recent_ccf(abspaths):
        """
        Returns the absolute path of the most recent CCF file.
    
        Args:
            abspaths: the absolute path of the files to evaluate.
    
        Output:
            the absolute path of the most recent file.
        """
    
        maxn = 0
        for f in abspaths:
            f_aux = os.path.basename(f)
            num = int(re.search(r'\d+', f_aux).group(0))
            if num > maxn:
                maxn = num
                maxf = f
    
>       return maxf
               ^^^^
E       UnboundLocalError: cannot access local variable 'maxf' where it is not associated with a value

/harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py:125: UnboundLocalError
----------------------------- Captured stderr call -----------------------------
omdrifthist - WARNING - Executing /harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py {'set': 'test_omdrift.fits', 'pages': '2', 'plotfile': './test_plot2', 'nbins': 50, 'trackradius': 0.5}
omdrifthist - WARNING - Format not found in the plotfile parameter. Using /harness/packages/pyomdrifthist/test/test_plot2.pdf as default.
------------------------------ Captured log call -------------------------------
WARNING  omdrifthist:logger.py:158 Executing /harness/lib/python/pysas/pyomdrifthist/pyomdrifthist.py {'set': 'test_omdrift.fits', 'pages': '2', 'plotfile': './test_plot2', 'nbins': 50, 'trackradius': 0.5}
WARNING  omdrifthist:logger.py:158 Format not found in the plotfile parameter. Using /harness/packages/pyomdrifthist/test/test_plot2.pdf as default.
DEBUG    omdrifthist:logger.py:158 Working with /harness/packages/pyomdrifthist/test/test_plot2.pdf
DEBUG    omdrifthist:logger.py:158 Looking for platescale...
DEBUG    omdrifthist:logger.py:158 List of folders found in CCF path: ['/ccf/pub', '/ccf/priv/rt', '/ccf/priv/validation', '/harness/lib/testccf']
DEBUG    omdrifthist:logger.py:158 /ccf/pub does not contain OM astronometry calibration file.
DEBUG    omdrifthist:logger.py:158 /ccf/priv/rt does not contain OM astronometry calibration file.
DEBUG    omdrifthist:logger.py:158 /ccf/priv/validation does not contain OM astronometry calibration file.
DEBUG    omdrifthist:logger.py:158 /harness/lib/testccf does not contain OM astronometry calibration file.
DEBUG    omdrifthist:logger.py:158 Found the following OM CCF compatible files: []
=========================== short test summary info ============================
FAILED pyomdrifthist_test.py::test_get_platescale - UnboundLocalError: cannot...
FAILED pyomdrifthist_test.py::test_get_more_recent_ccf - UnboundLocalError: c...
FAILED pyomdrifthist_test.py::test_general_png - UnboundLocalError: cannot ac...
FAILED pyomdrifthist_test.py::test_general_pdf - UnboundLocalError: cannot ac...
FAILED pyomdrifthist_test.py::test_general1pdf - UnboundLocalError: cannot ac...
FAILED pyomdrifthist_test.py::test_general2pdf - UnboundLocalError: cannot ac...
========================= 6 failed, 2 passed in 2.56s ==========================
Error while running ./testpyomdrifthist
ERROR: one of the tests failed
