From f86b24f364f980c46e72ece6cb6caaacc8c9eb9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CBrittany?= Date: Thu, 21 Dec 2023 15:23:52 -0500 Subject: [PATCH] update nose-specific methods as pytest support for nose tests is deprecated and will be removed in a future release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: “Brittany --- tests/core/baseline_test.py | 2 +- tests/core/secrets_collection_test.py | 2 +- tests/plugins/aws_key_test.py | 2 +- tests/plugins/common/initialize_test.py | 2 +- tests/plugins/high_entropy_strings_test.py | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/core/baseline_test.py b/tests/core/baseline_test.py index 343560c3b..efd7c7ea2 100644 --- a/tests/core/baseline_test.py +++ b/tests/core/baseline_test.py @@ -22,7 +22,7 @@ class TestInitializeBaseline: - def setup(self): + def setup_method(self): self.plugins = ( Base64HighEntropyString(4.5), HexHighEntropyString(3), diff --git a/tests/core/secrets_collection_test.py b/tests/core/secrets_collection_test.py index 0524af5cf..28cbb96e4 100644 --- a/tests/core/secrets_collection_test.py +++ b/tests/core/secrets_collection_test.py @@ -269,7 +269,7 @@ class TestBaselineInputOutput: related to that ability. """ - def setup(self): + def setup_method(self): self.logic = secrets_collection_factory( secrets=[ { diff --git a/tests/plugins/aws_key_test.py b/tests/plugins/aws_key_test.py index 9c74642e6..e52d7e7e6 100644 --- a/tests/plugins/aws_key_test.py +++ b/tests/plugins/aws_key_test.py @@ -16,7 +16,7 @@ class TestAWSKeyDetector(object): - def setup(self): + def setup_method(self): self.example_key = 'AKIAZZZZZZZZZZZZZZZZ' @pytest.mark.parametrize( diff --git a/tests/plugins/common/initialize_test.py b/tests/plugins/common/initialize_test.py index d69249fcc..86bc3fa72 100644 --- a/tests/plugins/common/initialize_test.py +++ b/tests/plugins/common/initialize_test.py @@ -40,7 +40,7 @@ def test_fails_on_bad_initialization(self): class TestFromSecretType: - def setup(self): + def setup_method(self): self.settings = [ { 'name': 'Base64HighEntropyString', diff --git a/tests/plugins/high_entropy_strings_test.py b/tests/plugins/high_entropy_strings_test.py index 90fa2b7c4..7207104e9 100644 --- a/tests/plugins/high_entropy_strings_test.py +++ b/tests/plugins/high_entropy_strings_test.py @@ -140,7 +140,7 @@ def test_entropy_upper_limit(self): class TestRegularBase64HighEntropyStrings(HighEntropyStringsTest): - def setup(self): + def setup_method(self): super(TestRegularBase64HighEntropyStrings, self).setup( # Testing default limit, as suggested by truffleHog. logic=Base64HighEntropyString( @@ -238,7 +238,7 @@ def test_env_file(self): class TestUrlSafeBase64HighEntropyStrings(HighEntropyStringsTest): - def setup(self): + def setup_method(self): super(TestUrlSafeBase64HighEntropyStrings, self).setup( # Testing default limit, as suggested by truffleHog. logic=Base64HighEntropyString( @@ -267,7 +267,7 @@ def calculate_shannon_entropy(self, data): class TestHexHighEntropyStrings(HighEntropyStringsTest): - def setup(self): + def setup_method(self): super(TestHexHighEntropyStrings, self).setup( # Testing default limit, as suggested by truffleHog. logic=HexHighEntropyString(