Skip to content

Commit 5ecc4f5

Browse files
ericwblukehinds
andauthored
Mock part of python 3.x (#685)
Now that Bandit is Python 3.5+ only, there is no need to install the mock library. The mock library became part of base Python as of Python 3.3. See [1] [1] https://pypi.org/project/mock/ Signed-off-by: Eric Brown <[email protected]> Co-authored-by: Luke Hinds <[email protected]>
1 parent 0e23506 commit 5ecc4f5

14 files changed

+15
-14
lines changed

test-requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
coverage>=4.5.4 # Apache-2.0
55
fixtures>=3.0.0 # Apache-2.0/BSD
66
hacking>=2.0.0 # Apache-2.0
7-
mock>=3.0.5 # BSD
87
stestr>=2.5.0 # Apache-2.0
98
testscenarios>=0.5.0 # Apache-2.0/BSD
109
testtools>=2.3.0 # MIT

tests/unit/cli/test_baseline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
import os
88
import subprocess
9+
from unittest import mock
910

1011
import fixtures
1112
import git
12-
import mock
1313
import testtools
1414

1515
import bandit.cli.baseline as baseline

tests/unit/cli/test_config_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
import importlib
88
import logging
9+
from unittest import mock
910

10-
import mock
1111
import testtools
1212
import yaml
1313

tests/unit/cli/test_main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
import logging
66
import os
7+
from unittest import mock
78

89
import fixtures
9-
import mock
1010
import testtools
1111

1212
from bandit.cli import main as bandit

tests/unit/core/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
import os
66
import tempfile
77
import textwrap
8+
from unittest import mock
89
import uuid
910

1011
import fixtures
11-
import mock
1212
import testtools
1313

1414
from bandit.core import config

tests/unit/core/test_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# SPDX-License-Identifier: Apache-2.0
66

77
import ast
8+
from unittest import mock
89

9-
import mock
1010
import testtools
1111

1212
from bandit.core import context

tests/unit/core/test_issue.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
#
55
# SPDX-License-Identifier: Apache-2.0
66

7-
import mock
7+
from unittest import mock
8+
89
import testtools
910

1011
import bandit

tests/unit/core/test_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
# SPDX-License-Identifier: Apache-2.0
66

77
import os
8+
from unittest import mock
89

910
import fixtures
10-
import mock
1111
import testtools
1212

1313
from bandit.core import config

tests/unit/core/test_test_set.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
#
55
# SPDX-License-Identifier: Apache-2.0
66

7-
import mock
7+
from unittest import mock
8+
89
from stevedore import extension
910
import testtools
1011

tests/unit/formatters/test_html.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
import collections
77
import tempfile
8+
from unittest import mock
89

910
import bs4
10-
import mock
1111
import testtools
1212

1313
import bandit

tests/unit/formatters/test_json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import collections
66
import json
77
import tempfile
8+
from unittest import mock
89

9-
import mock
1010
import testtools
1111

1212
import bandit

tests/unit/formatters/test_screen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
import collections
77
import tempfile
8+
from unittest import mock
89

9-
import mock
1010
import testtools
1111

1212
import bandit

tests/unit/formatters/test_text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
import collections
77
import tempfile
8+
from unittest import mock
89

9-
import mock
1010
import testtools
1111

1212
import bandit

tests/unit/formatters/test_yaml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
import collections
66
import tempfile
7+
from unittest import mock
78

8-
import mock
99
import testtools
1010
import yaml
1111

0 commit comments

Comments
 (0)