1
1
import pytest
2
+ import platform
2
3
3
4
from testgres import ExecUtilException
4
5
from testgres import LocalOperations
@@ -10,10 +11,16 @@ class TestLocalOperations:
10
11
def setup (self ):
11
12
self .operations = LocalOperations ()
12
13
14
+ def skip_if_windows ():
15
+ if platform .system ().lower ()== "windows" :
16
+ pytest .skip ("This test does not support Windows." )
17
+
13
18
def test_exec_command_success (self ):
14
19
"""
15
20
Test exec_command for successful command execution.
16
21
"""
22
+ __class__ .skip_if_windows ()
23
+
17
24
cmd = "python3 --version"
18
25
response = self .operations .exec_command (cmd ,wait_exit = True ,shell = True )
19
26
@@ -23,6 +30,8 @@ def test_exec_command_failure(self):
23
30
"""
24
31
Test exec_command for command execution failure.
25
32
"""
33
+ __class__ .skip_if_windows ()
34
+
26
35
cmd = "nonexistent_command"
27
36
while True :
28
37
try :
@@ -37,6 +46,8 @@ def test_exec_command_failure__expect_error(self):
37
46
"""
38
47
Test exec_command for command execution failure.
39
48
"""
49
+ __class__ .skip_if_windows ()
50
+
40
51
cmd = "nonexistent_command"
41
52
42
53
exit_status ,result ,error = self .operations .exec_command (cmd ,verbose = True ,wait_exit = True ,shell = True ,expect_error = True )