@@ -681,9 +681,16 @@ async def test_invalid_starttask(one_conf, flow, scheduler, start):
681
681
"Stop cycle point '20030101T0000Z' will have no effect as it"
682
682
" is after the final cycle point '20020101T0000Z'."
683
683
),
684
- # Not detectable from validate
685
- # ('initial', 'stop', 'start', 'final', False, "asdf"),
686
- # ('initial', 'stop', 'final', 'start', False, "asdf"),
684
+ (
685
+ 'initial' , 'stop' , 'start' , 'final' , False ,
686
+ "Stop cycle point '20010101T0000Z' will have no effect as it"
687
+ " is before the start cycle point '20020101T0000Z'."
688
+ ),
689
+ (
690
+ 'initial' , 'stop' , 'final' , 'start' , False ,
691
+ "Start cycle point '20030101T0000Z' will have no effect as it"
692
+ " is after the final cycle point '20020101T0000Z'."
693
+ ),
687
694
(
688
695
'initial' , 'final' , 'start' , 'stop' , True ,
689
696
"Stop cycle point '20030101T0000Z' will have no effect as it"
@@ -694,7 +701,11 @@ async def test_invalid_starttask(one_conf, flow, scheduler, start):
694
701
"Stop cycle point '20020101T0000Z' will have no effect as it"
695
702
" is after the final cycle point '20010101T0000Z'."
696
703
),
697
- # ('start', 'initial', 'stop', 'final', True, "asdf"),
704
+ (
705
+ 'start' , 'initial' , 'stop' , 'final' , False ,
706
+ "Start cycle point '20000101T0000Z' will have no effect as it"
707
+ " is before the initial cycle point '20010101T0000Z'."
708
+ ),
698
709
(
699
710
'start' , 'initial' , 'final' , 'stop' , True ,
700
711
"Stop cycle point '20030101T0000Z' will have no effect as it"
@@ -734,8 +745,19 @@ async def test_invalid_starttask(one_conf, flow, scheduler, start):
734
745
('final' , 'stop' , 'start' , 'initial' , True , WorkflowConfigError ),
735
746
)
736
747
)
737
- def test_milestone_cycle_points (
738
- a , b , c , d , validation_fail , err , flow , validate , scheduler , start , caplog
748
+ async def test_milestone_cycle_points (
749
+ a ,
750
+ b ,
751
+ c ,
752
+ d ,
753
+ validation_fail ,
754
+ err ,
755
+ flow ,
756
+ validate ,
757
+ scheduler ,
758
+ start ,
759
+ log_filter ,
760
+ caplog ,
739
761
):
740
762
"""Ensure that all combinations of
741
763
"""
@@ -749,11 +771,18 @@ def test_milestone_cycle_points(
749
771
'graph' : {'P1Y' : 'foo' }
750
772
},
751
773
})
752
- if not err :
753
- validate (wid )
754
- elif isinstance (err , str ):
755
- validate (wid )
756
- assert err in caplog .messages
757
- else :
758
- with pytest .raises (err ):
774
+ if validation_fail :
775
+ if not err :
759
776
validate (wid )
777
+ elif isinstance (err , str ):
778
+ validate (wid )
779
+ assert err in caplog .messages
780
+ else :
781
+ with pytest .raises (err ):
782
+ validate (wid )
783
+
784
+ else :
785
+ schd = scheduler (wid , startcp = str (order ['start' ]))
786
+ async with start (schd ) as log :
787
+ assert err in caplog .messages
788
+
0 commit comments