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
No related branches found
No related tags found
1 merge request!7Return non zero code on failure
Pipeline #13255 failed with stage
in 40 seconds
......@@ -5,4 +5,5 @@ __pycache__
.venv
.idea
dist/
results*/
\ No newline at end of file
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.
Finish editing this message first!
Please register or to comment