@@ -34,8 +34,8 @@ def it_has_a_sequence_of_the_runs_it_contains(self, runs_fixture):
3434 assert runs == [run_ , run_2_ ]
3535
3636 def it_can_add_a_run_to_itself (self , add_run_fixture ):
37- paragraph , text , expected_xml = add_run_fixture
38- run = paragraph .add_run (text )
37+ paragraph , text , style , expected_xml = add_run_fixture
38+ run = paragraph .add_run (text , style )
3939 assert paragraph ._p .xml == expected_xml
4040 assert isinstance (run , Run )
4141 assert run ._r is paragraph ._p .r_lst [0 ]
@@ -66,21 +66,29 @@ def it_knows_the_text_it_contains(self, text_prop_fixture):
6666
6767 # fixtures -------------------------------------------------------
6868
69- @pytest .fixture (params = [None , '' , 'foobar' ])
69+ @pytest .fixture (params = [
70+ (None , None ), (None , 'Strong' ), ('foobar' , None ), ('foobar' , 'Strong' )
71+ ])
7072 def add_run_fixture (self , request , paragraph ):
71- text = request .param
73+ text , style = request .param
7274 r_bldr = an_r ()
75+ if style :
76+ r_bldr .with_child (
77+ an_rPr ().with_child (an_rStyle ().with_val (style ))
78+ )
7379 if text :
7480 r_bldr .with_child (a_t ().with_text (text ))
7581 expected_xml = a_p ().with_nsdecls ().with_child (r_bldr ).xml ()
76- return paragraph , text , expected_xml
82+ return paragraph , text , style , expected_xml
83+
84+ # fixture components ---------------------------------------------
7785
7886 @pytest .fixture
7987 def p_ (self , request , r_ , r_2_ ):
8088 return instance_mock (request , CT_P , r_lst = (r_ , r_2_ ))
8189
8290 @pytest .fixture
83- def paragraph (self , request ):
91+ def paragraph (self ):
8492 p = a_p ().with_nsdecls ().element
8593 return Paragraph (p )
8694
0 commit comments