forked from apache/airflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor consolidate import from io (apache#34377)
- Loading branch information
Showing
27 changed files
with
131 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,12 +16,12 @@ | |
# under the License. | ||
from __future__ import annotations | ||
|
||
import io | ||
import json | ||
import os | ||
import re | ||
import tempfile | ||
from contextlib import redirect_stdout | ||
from io import StringIO | ||
|
||
import pytest | ||
|
||
|
@@ -121,7 +121,7 @@ def test_cli_delete_user(self): | |
"test3", | ||
] | ||
) | ||
with redirect_stdout(io.StringIO()) as stdout: | ||
with redirect_stdout(StringIO()) as stdout: | ||
user_command.users_delete(args) | ||
assert 'User "test3" deleted' in stdout.getvalue() | ||
|
||
|
@@ -152,7 +152,7 @@ def test_cli_delete_user_by_email(self): | |
"[email protected]", | ||
] | ||
) | ||
with redirect_stdout(io.StringIO()) as stdout: | ||
with redirect_stdout(StringIO()) as stdout: | ||
user_command.users_delete(args) | ||
assert 'User "test4" deleted' in stdout.getvalue() | ||
|
||
|
@@ -225,7 +225,7 @@ def test_cli_list_users(self): | |
] | ||
) | ||
user_command.users_create(args) | ||
with redirect_stdout(io.StringIO()) as stdout: | ||
with redirect_stdout(StringIO()) as stdout: | ||
user_command.users_list(self.parser.parse_args(["users", "list"])) | ||
stdout = stdout.getvalue() | ||
for i in range(3): | ||
|
@@ -368,7 +368,7 @@ def test_cli_add_user_role(self, create_user_test4): | |
), "User should not yet be a member of role 'Op'" | ||
|
||
args = self.parser.parse_args(["users", "add-role", "--username", "test4", "--role", "Op"]) | ||
with redirect_stdout(io.StringIO()) as stdout: | ||
with redirect_stdout(StringIO()) as stdout: | ||
user_command.users_manage_role(args, remove=False) | ||
assert 'User "test4" added to role "Op"' in stdout.getvalue() | ||
|
||
|
@@ -382,7 +382,7 @@ def test_cli_remove_user_role(self, create_user_test4): | |
), "User should have been created with role 'Viewer'" | ||
|
||
args = self.parser.parse_args(["users", "remove-role", "--username", "test4", "--role", "Viewer"]) | ||
with redirect_stdout(io.StringIO()) as stdout: | ||
with redirect_stdout(StringIO()) as stdout: | ||
user_command.users_manage_role(args, remove=True) | ||
assert 'User "test4" removed from role "Viewer"' in stdout.getvalue() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.