Skip to content
Snippets Groups Projects
Commit 00326c72 authored by Gerhard Raven's avatar Gerhard Raven
Browse files

reset global algorithm store at start of each python test

parent a93786f3
No related branches found
No related tags found
2 merge requests!1103Draft: Add AnalysisHelpers to DaVinci Stack,!904notify user if a specified option is overruled, fix python test
Pipeline #5684095 passed
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
# or submit itself to any jurisdiction. # # or submit itself to any jurisdiction. #
############################################################################### ###############################################################################
from PyConf.Algorithms import Gaudi__Examples__VoidConsumer as VoidConsumer from PyConf.Algorithms import Gaudi__Examples__VoidConsumer as VoidConsumer
from PyConf.components import Algorithm
from PyConf import components
from DaVinci import Options from DaVinci import Options
from DaVinci.algorithms import (make_fsr_algs, create_lines_filter, add_filter, from DaVinci.algorithms import (make_fsr_algs, create_lines_filter, add_filter,
...@@ -18,7 +20,15 @@ from PyConf.application import default_raw_event ...@@ -18,7 +20,15 @@ from PyConf.application import default_raw_event
from GaudiConf.LbExec import InputProcessTypes from GaudiConf.LbExec import InputProcessTypes
def reset_global_store(algorithm_store={}):
old_algorithm_store = Algorithm._algorithm_store
Algorithm._algorithm_store = algorithm_store
components._IDENTITY_TABLE.clear()
return old_algorithm_store
def test_define_write_fsr(): def test_define_write_fsr():
reset_global_store()
""" """
Check if DaVinci imports correctly the algorithm to merge and write FSRs. Check if DaVinci imports correctly the algorithm to merge and write FSRs.
""" """
...@@ -35,6 +45,7 @@ def test_define_write_fsr(): ...@@ -35,6 +45,7 @@ def test_define_write_fsr():
def test_add_hlt2_filter(): def test_add_hlt2_filter():
reset_global_store()
""" """
Check if DaVinci is able to implement correctly a filter on an HLT2 line. Check if DaVinci is able to implement correctly a filter on an HLT2 line.
""" """
...@@ -58,6 +69,7 @@ def test_add_hlt2_filter(): ...@@ -58,6 +69,7 @@ def test_add_hlt2_filter():
def test_add_spruce_filter(): def test_add_spruce_filter():
reset_global_store()
""" """
Check if DaVinci is able to implement correctly a filter on a Sprucing line. Check if DaVinci is able to implement correctly a filter on a Sprucing line.
""" """
...@@ -77,6 +89,7 @@ def test_add_spruce_filter(): ...@@ -77,6 +89,7 @@ def test_add_spruce_filter():
def test_add_void_filter(): def test_add_void_filter():
reset_global_store()
""" """
Check if DaVinci is able to implement correcty a Void filter Check if DaVinci is able to implement correcty a Void filter
if 'HLT_PASS' string is not found in the filter code." if 'HLT_PASS' string is not found in the filter code."
...@@ -92,6 +105,7 @@ def test_add_void_filter(): ...@@ -92,6 +105,7 @@ def test_add_void_filter():
def test_apply_filters(): def test_apply_filters():
reset_global_store()
""" """
Check if DaVinci applies correctly a filter in front of a given algorithm Check if DaVinci applies correctly a filter in front of a given algorithm
""" """
...@@ -113,6 +127,7 @@ def test_apply_filters(): ...@@ -113,6 +127,7 @@ def test_apply_filters():
def test_configured_funtuple(): def test_configured_funtuple():
reset_global_store()
""" """
Check if the configured_FunTuple provides a correct instance of FunTuple. Check if the configured_FunTuple provides a correct instance of FunTuple.
""" """
...@@ -146,6 +161,7 @@ def test_configured_funtuple(): ...@@ -146,6 +161,7 @@ def test_configured_funtuple():
def test_get_odin(): def test_get_odin():
reset_global_store()
""" """
Check if get_odin provides a correct instance of ODIN. Check if get_odin provides a correct instance of ODIN.
""" """
...@@ -164,6 +180,7 @@ def test_get_odin(): ...@@ -164,6 +180,7 @@ def test_get_odin():
def test_get_decreports(): def test_get_decreports():
reset_global_store()
""" """
Check if get_decreports provide a correct instance of HltDecReportsDecoder. Check if get_decreports provide a correct instance of HltDecReportsDecoder.
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment