Skip to content

Commit 29e2abc

Browse files
committed
Add print method to run result - #49
1 parent 9d0ea3b commit 29e2abc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pytest_console_scripts.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,12 @@ def __init__(self, returncode, stdout, stderr, print_result):
113113
self.stdout = stdout
114114
self.stderr = stderr
115115
if print_result:
116-
print('# Script return code:', returncode)
117-
print('# Script stdout:', stdout, sep='\n')
118-
print('# Script stderr:', stderr, sep='\n')
116+
self.print()
117+
118+
def print(self):
119+
print('# Script return code:', self.returncode)
120+
print('# Script stdout:', self.stdout, sep='\n')
121+
print('# Script stderr:', self.stderr, sep='\n')
119122

120123

121124
class ScriptRunner(object):

0 commit comments

Comments
 (0)