@@ -29,8 +29,11 @@ def it_has_a_sequence_of_the_runs_it_contains(self, runs_fixture):
2929 assert runs == [run_ , run_2_ ]
3030
3131 def it_can_add_a_run_to_itself (self , add_run_fixture ):
32- paragraph , expected_xml = add_run_fixture
33- run = paragraph .add_run ()
32+ paragraph , text , expected_xml = add_run_fixture
33+ if text is None :
34+ run = paragraph .add_run ()
35+ else :
36+ run = paragraph .add_run (text )
3437 assert paragraph ._p .xml == expected_xml
3538 assert isinstance (run , Run )
3639 assert run ._r is paragraph ._p .r_lst [0 ]
@@ -61,10 +64,14 @@ def it_knows_the_text_it_contains(self, text_prop_fixture):
6164
6265 # fixtures -------------------------------------------------------
6366
64- @pytest .fixture
65- def add_run_fixture (self , paragraph ):
66- expected_xml = a_p ().with_nsdecls ().with_child (an_r ()).xml ()
67- return paragraph , expected_xml
67+ @pytest .fixture (params = [None , '' , 'foobar' ])
68+ def add_run_fixture (self , request , paragraph ):
69+ text = request .param
70+ r_bldr = an_r ()
71+ if text :
72+ r_bldr .with_child (a_t ().with_text (text ))
73+ expected_xml = a_p ().with_nsdecls ().with_child (r_bldr ).xml ()
74+ return paragraph , text , expected_xml
6875
6976 @pytest .fixture
7077 def p_ (self , request , r_ , r_2_ ):
0 commit comments