Skip to content

Commit

Permalink
Small syntax and formatting cleanup (PyCQA#676)
Browse files Browse the repository at this point in the history
* Avoid multiple lines when possible
* Avoid creating variables for single use

Signed-off-by: Eric Brown <browne@vmware.com>
  • Loading branch information
ericwb authored and mikespallino committed Jan 7, 2022
1 parent fb92550 commit ce0cb51
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/functional/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,11 @@ def test_mark_safe(self):

def test_exec(self):
'''Test the `exec` example.'''
filename = 'exec.py'
expect = {
'SEVERITY': {'UNDEFINED': 0, 'LOW': 0, 'MEDIUM': 1, 'HIGH': 0},
'CONFIDENCE': {'UNDEFINED': 0, 'LOW': 0, 'MEDIUM': 0,
'HIGH': 1}
'CONFIDENCE': {'UNDEFINED': 0, 'LOW': 0, 'MEDIUM': 0, 'HIGH': 1}
}
self.check_example(filename, expect)
self.check_example('exec.py', expect)

def test_hardcoded_passwords(self):
'''Test for hard-coded passwords.'''
Expand Down Expand Up @@ -276,12 +274,11 @@ def test_subdirectory_okay(self):

def test_os_chmod(self):
'''Test setting file permissions.'''
filename = 'os-chmod.py'
expect = {
'SEVERITY': {'UNDEFINED': 0, 'LOW': 0, 'MEDIUM': 2, 'HIGH': 8},
'CONFIDENCE': {'UNDEFINED': 0, 'LOW': 0, 'MEDIUM': 1, 'HIGH': 9}
}
self.check_example(filename, expect)
self.check_example('os-chmod.py', expect)

def test_os_exec(self):
'''Test for `os.exec*`.'''
Expand Down

0 comments on commit ce0cb51

Please sign in to comment.