File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 15
15
"""Common fixtures."""
16
16
import os
17
17
import pathlib
18
+ import shutil
18
19
import random
19
20
import string
20
21
import sys
38
39
TEST_CONFIG : dict = {}
39
40
40
41
42
+ @pytest .fixture (scope = 'session' , autouse = True )
43
+ def clean_tmp ():
44
+ """Remove Trestle workspace in /tmp if there's one"""
45
+ if os .name == 'posix' :
46
+ curr_path = os .getcwd ()
47
+ os .chdir ("/tmp" )
48
+ try :
49
+ shutil .rmtree (".trestle" )
50
+ shutil .rmtree ("dist" )
51
+ shutil .rmtree ("catalogs" )
52
+ shutil .rmtree ("profiles" )
53
+ shutil .rmtree ("component-definitions" )
54
+ shutil .rmtree ("system-security-plans" )
55
+ shutil .rmtree ("assessment-plans" )
56
+ shutil .rmtree ("assessment-results" )
57
+ shutil .rmtree ("plan-of-action-and-milestones" )
58
+ finally :
59
+ os .chdir (curr_path )
60
+
61
+
41
62
@pytest .fixture (scope = 'function' )
42
63
def rand_str ():
43
64
"""Return a random string."""
You can’t perform that action at this time.
0 commit comments