Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alan De Vaney
sdk-codegen
Commits
08248c07
Unverified
Commit
08248c07
authored
2 years ago
by
John Kaster
Committed by
GitHub
2 years ago
Browse files
Options
Download
Email Patches
Plain Diff
fix: handle python crashed test (#1111)
parent
918004bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/tests/conftest.py
+14
-9
python/tests/conftest.py
with
14 additions
and
9 deletions
+14
-9
python/tests/conftest.py
+
14
-
9
View file @
08248c07
...
...
@@ -89,18 +89,23 @@ def create_test_users(
):
user_ids
:
List
[
int
]
=
[]
for
u
in
users
:
# TODO: if the test crashes it doesn't clean up the users.
user
=
sdk40
.
create_user
(
models40
.
WriteUser
(
first_name
=
u
[
"first_name"
],
last_name
=
u
[
"last_name"
])
)
if
user
.
id
:
users
=
sdk40
.
search_users
(
first_name
=
u
[
"first_name"
],
last_name
=
u
[
"last_name"
])
if
len
(
users
)
>
0
:
# recover from crashed test, dummy
user
=
users
[
0
]
user_ids
.
append
(
user
.
id
)
email
=
f
"
{
u
[
'first_name'
]
}
.
{
u
[
'last_name'
]
}{
email_domain
}
"
sdk40
.
create_user
_credentials_email
(
user
.
id
,
models40
.
Write
CredentialsEmail
(
email
=
email
)
else
:
user
=
sdk40
.
create_user
(
models40
.
Write
User
(
first_name
=
u
[
"first_name"
],
last_name
=
u
[
"last_name"
]
)
)
if
user
.
id
:
user_ids
.
append
(
user
.
id
)
email
=
f
"
{
u
[
'first_name'
]
}
.
{
u
[
'last_name'
]
}{
email_domain
}
"
sdk40
.
create_user_credentials_email
(
user
.
id
,
models40
.
WriteCredentialsEmail
(
email
=
email
)
)
yield
for
user_id
in
user_ids
:
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets