Skip to content
Snippets Groups Projects
Commit 05306969 authored by Bryan Brancotte's avatar Bryan Brancotte
Browse files

write produced code in temp file to help debug tests

parent e1a179dc
Branches
Tags
1 merge request!7Return non zero code on failure
Pipeline #13255 failed
......@@ -6,3 +6,4 @@ __pycache__
.idea
dist/
results*/
*.candidate.nf
\ No newline at end of file
import os
import unittest
from src.outils import *
......@@ -36,6 +37,10 @@ class TestOutils(unittest.TestCase):
with open("tests/ressources/outils/remove_comments_wo.nf", 'r') as f:
code_wo_comments = f.read()
self.assertEqual(remove_comments(code_with_comments), code_wo_comments)
produced = remove_comments(code_with_comments)
with open(candidate := "tests/ressources/outils/remove_comments_wo.candidate.nf", 'w') as f:
f.write(produced)
self.assertEqual(produced, code_wo_comments)
os.unlink(candidate)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment