File tree 1 file changed +8
-4
lines changed
tests/appsec/integrations/flask_tests
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 24
24
@pytest .mark .parametrize ("aws_lambda" , ["any" , None ])
25
25
def test_loading (appsec_enabled , iast_enabled , aws_lambda ):
26
26
flask_app = pathlib .Path (__file__ ).parent / "mini.py"
27
- env = {}
27
+ env = os . environ . copy ()
28
28
if appsec_enabled :
29
29
env ["DD_APPSEC_ENABLED" ] = appsec_enabled
30
+ else :
31
+ env .pop ("DD_APPSEC_ENABLED" , None )
30
32
if iast_enabled :
31
33
env ["DD_IAST_ENABLED" ] = iast_enabled
34
+ else :
35
+ env .pop ("DD_IAST_ENABLED" , None )
32
36
if aws_lambda :
33
37
env ["AWS_LAMBDA_FUNCTION_NAME" ] = aws_lambda
34
-
35
- all_env = os . environ | env
38
+ else :
39
+ env . pop ( "AWS_LAMBDA_FUNCTION_NAME" , None )
36
40
37
41
process = subprocess .Popen (
38
42
["python" , str (flask_app )],
39
43
stdout = subprocess .PIPE ,
40
44
stderr = subprocess .PIPE ,
41
- env = all_env ,
45
+ env = env ,
42
46
)
43
47
for i in range (16 ):
44
48
time .sleep (1 )
You can’t perform that action at this time.
0 commit comments