From 2e69a93c9eedea383c7d93d37d58f25a969c00a8 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Mon, 27 Jul 2020 16:39:48 +0100
Subject: [PATCH] Fxied test

---
 Control/AthenaCommon/python/CFElements.py       |  1 -
 .../python/ComponentAccumulatorTest.py          | 17 ++++++++++++++---
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/Control/AthenaCommon/python/CFElements.py b/Control/AthenaCommon/python/CFElements.py
index 9097d8a4c57..c38f5de86c4 100755
--- a/Control/AthenaCommon/python/CFElements.py
+++ b/Control/AthenaCommon/python/CFElements.py
@@ -87,7 +87,6 @@ def checkSequenceConsistency( seq ):
     def __noSubSequenceOfName( s, n ):    
         for c in getSequenceChildren( s ):
             if isSequence( c ):
-                print("here", compName(c), n)
                 if compName(c) == n:
                     raise RuntimeError("Sequence {} contains sub-sequence of the same name".format(n) )
                 try:
diff --git a/Control/AthenaConfiguration/python/ComponentAccumulatorTest.py b/Control/AthenaConfiguration/python/ComponentAccumulatorTest.py
index 286ad3ac1b0..49e1531a915 100644
--- a/Control/AthenaConfiguration/python/ComponentAccumulatorTest.py
+++ b/Control/AthenaConfiguration/python/ComponentAccumulatorTest.py
@@ -192,6 +192,7 @@ class ForbidRecursiveSequences( unittest.TestCase ):
         # \__ AthAlgSeq (seq: PAR AND)
         #    \__ seq1 (seq: SEQ AND)
         #       \__ seq1 (seq: SEQ AND)
+        print("")
         def selfSequence():
             from AthenaCommon.CFElements import seqAND
             accTop = ComponentAccumulator()
@@ -228,13 +229,14 @@ class ForbidRecursiveSequences( unittest.TestCase ):
         def selfGrandParentSequence():
             from AthenaCommon.CFElements import seqAND
             accTop = ComponentAccumulator()
+            accTop.wasMerged()
             seq1 = seqAND("seq1")
             seq2 = seqAND("seq2")
             seq1_again = seqAND("seq1")
             accTop.addSequence(seq1)
             accTop.addSequence(seq2, parentName = "seq1")
             accTop.addSequence(seq1_again, parentName = "seq2")
-            accTop.wasMerged()
+
 
         #Can't merge sequences with the same name two steps below itself, e.g.
         # \__ AthAlgSeq (seq: PAR AND)
@@ -246,15 +248,24 @@ class ForbidRecursiveSequences( unittest.TestCase ):
             acc1=ComponentAccumulator()
             acc1.wasMerged()
             acc1.addSequence(seqAND("seq1"))
+
             acc2=ComponentAccumulator()
             acc2.wasMerged()
             acc2.addSequence(seqAND("seq2"))
-            acc2.addSequence(seqAND("seq1"), "seq2")
-            acc1.merge(acc2)
+            acc2.addSequence(seqAND("seq1"), parentName = "seq2")
+            acc1.merge(acc2, sequenceName="seq1")
 
+        print("selfSequence")
         self.assertRaises(RuntimeError, selfSequence )
+        print("selfSequence done")
+
+        print("selfGrandParentSequence")
         self.assertRaises(RuntimeError, selfGrandParentSequence )
+        print("selfGrandParentSequence done")
+
+        print("selfMergedGrandParentSequence")
         self.assertRaises(RuntimeError, selfMergedGrandParentSequence )
+        print("selfMergedGrandParentSequence done")
 
 class FailedMerging( unittest.TestCase ):
     def runTest( self ):
-- 
GitLab