We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b7656bf commit b30dd19Copy full SHA for b30dd19
tests/_remove_main.py
@@ -4,10 +4,17 @@
4
def remove_main(test):
5
"""voorbewerking van het bestand voor testen"""
6
7
- with open(test.fileName, 'r') as f:
+ global _originalFileName
8
+ global _fileName
9
+
10
+ _originalFileName = _fileName
11
12
+ with open(_fileName, 'r') as f:
13
file_contents = f.readlines()
14
- with open(test.fileName, 'w') as f:
15
+ tempfile = f"_{_fileName}.tmp"
16
17
+ with open(tempfile, 'w') as f:
18
state = 0
19
for line in file_contents:
20
if state == 0:
@@ -23,3 +30,5 @@ def remove_main(test):
23
30
if line.startswith('def '):
24
31
f.write(line)
25
32
state = 1
33
34
+ _fileName = tempfile
0 commit comments