File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22import collections
33import os
44import tempfile
5- import sys
65
76import yaml
87import pytest
@@ -454,7 +453,6 @@ def rule_accounts_tmout():
454453 return ssg .build_yaml .Rule .from_yaml (rule_file )
455454
456455
457- @pytest .mark .skipif (sys .version_info [0 ] < 3 , reason = "requires python3 or higher" )
458456def test_rule_to_xml_element (rule_accounts_tmout ):
459457 xmldiff_main = pytest .importorskip ("xmldiff.main" )
460458 rule_el = rule_accounts_tmout .to_xml_element ()
@@ -487,7 +485,6 @@ def value_system_crypto_policy():
487485 return ssg .build_yaml .Value .from_yaml (value_file )
488486
489487
490- @pytest .mark .skipif (sys .version_info [0 ] < 3 , reason = "requires python3 or higher" )
491488def test_value_to_xml_element (value_system_crypto_policy ):
492489 xmldiff_main = pytest .importorskip ("xmldiff.main" )
493490 value_el = value_system_crypto_policy .to_xml_element ()
Original file line number Diff line number Diff line change 11import pytest
22import os
3- import sys
43
54import ssg .controls
65import ssg .build_yaml
@@ -104,7 +103,6 @@ def test_controls_load(controls_manager):
104103 _load_test (controls_manager , "abcd" )
105104
106105
107- @pytest .mark .skipif (sys .version_info [0 ] < 3 , reason = "requires python3 or higher" )
108106def test_controls_invalid_rules (env_yaml ):
109107 existing_rules = {"accounts_tmout" , "configure_crypto_policy" }
110108 controls_manager = ssg .controls .ControlsManager (
@@ -115,7 +113,6 @@ def test_controls_invalid_rules(env_yaml):
115113 "Control abcd:R1 contains nonexisting rule(s) sshd_set_idle_timeout"
116114
117115
118- @pytest .mark .skipif (sys .version_info [0 ] < 3 , reason = "requires python3 or higher" )
119116def test_controls_levels (controls_manager ):
120117 # Default level is the lowest level
121118 c_1 = controls_manager .get_control ("abcd-levels" , "S1" )
Original file line number Diff line number Diff line change 11import os
2- import pytest
32import subprocess
4- import sys
5-
6- if sys .version_info < (3 , 0 ):
7- try :
8- # pytest v4.6 has allow_module_level
9- pytest .skip ("requires python3" , allow_module_level = True )
10- except TypeError :
11- # older pytest v2.7 does not have it and it is implied
12- pytest .skip ("requires python3" )
133
144DATADIR = os .path .abspath (os .path .join (os .path .dirname (__file__ ), "data" ))
155CMD = os .path .abspath (
Original file line number Diff line number Diff line change 11import os
2- import sys
3- import pytest
42from argparse import Namespace
53from utils .profile_tool import command_most_used_rules
64
@@ -16,7 +14,6 @@ def get_fake_args():
1614 )
1715
1816
19- @pytest .mark .skipif (sys .version_info [0 ] < 3 , reason = "requires python3" )
2017def test_command (capsys ):
2118 command_most_used_rules (get_fake_args ())
2219 captured = capsys .readouterr ()
You can’t perform that action at this time.
0 commit comments