[wp-trac] [WordPress Trac] #53363: Test tool and unit test improvements for 5.9

WordPress Trac noreply at wordpress.org
Fri Nov 26 12:52:14 UTC 2021


#53363: Test tool and unit test improvements for 5.9
--------------------------------------+---------------------
 Reporter:  desrosj                   |       Owner:  (none)
     Type:  task (blessed)            |      Status:  new
 Priority:  normal                    |   Milestone:  5.9
Component:  Build/Test Tools          |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------

Comment (by jrf):

 Replying to [comment:126 SergeyBiryukov]:
 > Replying to [comment:125 jrf]:
 > Yeah, I was considering moving the `expectOutputRegex()` call instead,
 but in my understanding that would mean `restore_previous_locale()` would
 have to run after it and could potentially never be called in case of
 failure, affecting other tests.

 Ah, I understand. However, there is a difference between assertions -
 which will fail the test on the first failed assertion - and these type of
 output expectations - which will evaluate the output after the rest of the
 test code has run (providing no unexpected errors were encountered) -.

 So moving the expectation up to ''before'' the function call generating
 the output, would be the way to go in this case.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53363#comment:127>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list