Skip to content

Commit 85743c3

Browse files
yoshi-automationtelpirion
authored andcommitted
feat: add field severity to findings; update retry configs (#53)
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/d5a3b809-9df8-4d37-93b2-9714b500d6ce/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 324294521 Source-Link: googleapis/googleapis@868615a PiperOrigin-RevId: 324035013 Source-Link: googleapis/googleapis@8cda089 PiperOrigin-RevId: 323803770 Source-Link: googleapis/googleapis@706053b PiperOrigin-RevId: 323795963 Source-Link: googleapis/googleapis@c1b9289 PiperOrigin-RevId: 323657371 Source-Link: googleapis/googleapis@1907f0f PiperOrigin-RevId: 323630732 Source-Link: googleapis/googleapis@74e8cf8 PiperOrigin-RevId: 323605868 Source-Link: googleapis/googleapis@0c6a730 PiperOrigin-RevId: 323472217 Source-Link: googleapis/googleapis@6a813ac PiperOrigin-RevId: 323062460 Source-Link: googleapis/googleapis@599ede9 PiperOrigin-RevId: 322867095 Source-Link: googleapis/googleapis@e26e183 PiperOrigin-RevId: 321179885 Source-Link: googleapis/googleapis@9362f58 PiperOrigin-RevId: 321179822 Source-Link: googleapis/googleapis@afa7f44
1 parent d7e82a0 commit 85743c3

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

securitycenter/snippets/noxfile.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,24 @@
3737

3838
TEST_CONFIG = {
3939
# You can opt out from the test for specific Python versions.
40-
"ignored_versions": ["2.7"],
40+
'ignored_versions': ["2.7"],
41+
4142
# An envvar key for determining the project id to use. Change it
4243
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a
4344
# build specific Cloud project. You can also use your own string
4445
# to use your own Cloud project.
45-
"gcloud_project_env": "GOOGLE_CLOUD_PROJECT",
46+
'gcloud_project_env': 'GOOGLE_CLOUD_PROJECT',
4647
# 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT',
48+
4749
# A dictionary you want to inject into your test. Don't put any
4850
# secrets here. These values will override predefined values.
49-
"envs": {},
51+
'envs': {},
5052
}
5153

5254

5355
try:
5456
# Ensure we can import noxfile_config in the project's directory.
55-
sys.path.append(".")
57+
sys.path.append('.')
5658
from noxfile_config import TEST_CONFIG_OVERRIDE
5759
except ImportError as e:
5860
print("No user noxfile_config found: detail: {}".format(e))
@@ -67,12 +69,12 @@ def get_pytest_env_vars():
6769
ret = {}
6870

6971
# Override the GCLOUD_PROJECT and the alias.
70-
env_key = TEST_CONFIG["gcloud_project_env"]
72+
env_key = TEST_CONFIG['gcloud_project_env']
7173
# This should error out if not set.
72-
ret["GOOGLE_CLOUD_PROJECT"] = os.environ[env_key]
74+
ret['GOOGLE_CLOUD_PROJECT'] = os.environ[env_key]
7375

7476
# Apply user supplied envs.
75-
ret.update(TEST_CONFIG["envs"])
77+
ret.update(TEST_CONFIG['envs'])
7678
return ret
7779

7880

@@ -81,7 +83,7 @@ def get_pytest_env_vars():
8183
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8"]
8284

8385
# Any default versions that should be ignored.
84-
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]
86+
IGNORED_VERSIONS = TEST_CONFIG['ignored_versions']
8587

8688
TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS])
8789

@@ -136,7 +138,7 @@ def lint(session):
136138
args = FLAKE8_COMMON_ARGS + [
137139
"--application-import-names",
138140
",".join(local_names),
139-
".",
141+
"."
140142
]
141143
session.run("flake8", *args)
142144

@@ -180,9 +182,9 @@ def py(session):
180182
if session.python in TESTED_VERSIONS:
181183
_session_tests(session)
182184
else:
183-
session.skip(
184-
"SKIPPED: {} tests are disabled for this sample.".format(session.python)
185-
)
185+
session.skip("SKIPPED: {} tests are disabled for this sample.".format(
186+
session.python
187+
))
186188

187189

188190
#

0 commit comments

Comments
 (0)