This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cbc
Recipients cbc, chris.jerdonek
Date 2012-08-02.00:08:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1343866086.09.0.796085026964.issue15518@psf.upfronthosting.co.za>
In-reply-to
Content
> There are at least two ways you could deal with this.  You could change the working directory to the temp directory in setUp() and change it back in tearDown().  This is a common pattern in the tests [...]

> Alternatively, you could save the temp directory path as an attribute of the test class, and then include it in your string match prior to calling the assert method.

Although I prefer explicitly testing that the subdirectory paths shows up in the reports and, in the case of the report_partial_closure test, the regex explicitly tests that the "only in" subdirectory is reported correctly, if I were to have to choose between the two options you propose, I would choose decorating the test instance with the strings as that would at least preserve the ability to perform the latter of the two explicit tests I mention and would not be subject to yet another file system point of failure while switching directories (even if that is a common pattern in the tests).

assertRegex is new from unittest2 and seems tailor-made for this use case to me. It gets the job done in explicitly correctly in the least amount of code. If you insist that I not use assertRegex for the report test, I will yield to your preferences. However, I would like your blessing to continue with assertRegex in this case.

In either event, I still will refactor the patch into separate test methods for the report methods as previously agreed after your continued feedback. And thank you again for your feedback above.
History
Date User Action Args
2012-08-02 00:08:06cbcsetrecipients: + cbc, chris.jerdonek
2012-08-02 00:08:06cbcsetmessageid: <1343866086.09.0.796085026964.issue15518@psf.upfronthosting.co.za>
2012-08-02 00:08:05cbclinkissue15518 messages
2012-08-02 00:08:03cbccreate