forked from github/pelican
Fix false-positive in content gen. test failures
Assert equal dirs by return value of diff subprocess, rather than its output. This prevents tests from failing when file contents are the same but the file modes are different. Fix #3042
This commit is contained in:
parent
f015ab89d9
commit
b10c7c699b
2 changed files with 42 additions and 26 deletions
|
|
@ -218,6 +218,23 @@ class LogCountHandler(BufferingHandler):
|
|||
])
|
||||
|
||||
|
||||
def diff_subproc(first, second):
|
||||
"""
|
||||
Return a subprocess that runs a diff on the two paths.
|
||||
|
||||
Check results with::
|
||||
|
||||
>>> out_stream, err_stream = proc.communicate()
|
||||
>>> didCheckFail = proc.returnCode != 0
|
||||
"""
|
||||
return subprocess.Popen(
|
||||
['git', '--no-pager', 'diff', '--no-ext-diff', '--exit-code',
|
||||
'-w', first, second],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE
|
||||
)
|
||||
|
||||
|
||||
class LoggedTestCase(unittest.TestCase):
|
||||
"""A test case that captures log messages."""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue