mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-10-15 10:33:53 +00:00
Approve current output and fix the approval test reporter
Approved the 30 day fixture output as-is so there is a baseline before refactoring. Conjured Mana Cake is still wrong here, that changes later. The approval test was also crashing with "no reporter configuration" instead of showing a diff. pytest-approvaltests 0.2.4 doesn't work with approvaltests 19, so pass PythonNativeReporter directly.
This commit is contained in:
1 parent
d6407909c7
commit
5f113a1d2f
3 files changed
+386
-3
No files matched your search
@@ -1,9 +1,16 @@
|
||||
import io
|
||||
import sys
|
||||
|
||||
from approvaltests import verify
|
||||
from approvaltests import Options, verify
|
||||
from approvaltests.reporters import PythonNativeReporter
|
||||
|
||||
from texttest_fixture import main
|
||||
|
||||
# Print the diff to stdout on a mismatch rather than launching a GUI diff tool,
|
||||
# so the test behaves identically locally, headless and in CI.
|
||||
REPORTER = PythonNativeReporter()
|
||||
|
||||
|
||||
def test_gilded_rose_approvals():
|
||||
orig_sysout = sys.stdout
|
||||
try:
|
||||
@@ -15,7 +22,8 @@ def test_gilded_rose_approvals():
|
||||
finally:
|
||||
sys.stdout = orig_sysout
|
||||
|
||||
verify(answer)
|
||||
verify(answer, options=Options().with_reporter(REPORTER))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_gilded_rose_approvals()
|
||||
test_gilded_rose_approvals()
|
||||
Reference in new issue
Block a user