Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump ruff from 0.5.4 to 0.6.4 #2214

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions client/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
TIME_KEYCLICK_ACTION = 5000


@pytest.fixture()
@pytest.fixture
def lang(request):
"""
Setup: Override $LANG as parameterized and configure locale accordingly.
Expand All @@ -73,7 +73,7 @@ def lang(request):
configure_locale_and_language()


@pytest.fixture()
@pytest.fixture
def print_dialog(request, mocker):
"""
Fixture that returns a print dialog. Tests using this fixture must
Expand Down Expand Up @@ -117,7 +117,7 @@ def _stub_export(mocker, status_string=None):
return export


@pytest.fixture()
@pytest.fixture
def export_wizard_multifile(mocker, homedir):
mocker.patch("PyQt5.QtWidgets.QApplication.activeWindow", return_value=QMainWindow())

Expand All @@ -130,7 +130,7 @@ def export_wizard_multifile(mocker, homedir):
)


@pytest.fixture()
@pytest.fixture
def export_wizard(mocker, homedir):
mocker.patch("PyQt5.QtWidgets.QApplication.activeWindow", return_value=QMainWindow())

Expand All @@ -139,7 +139,7 @@ def export_wizard(mocker, homedir):
return conversation.ExportWizard(export_device, "file123.jpg", ["/mock/path/to/file"])


@pytest.fixture()
@pytest.fixture
def export_transcript_wizard(mocker, homedir):
mocker.patch("PyQt5.QtWidgets.QApplication.activeWindow", return_value=QMainWindow())

Expand All @@ -148,15 +148,15 @@ def export_transcript_wizard(mocker, homedir):
return conversation.ExportWizard(export_device, "transcript.txt", ["/some/path/transcript.txt"])


@pytest.fixture()
@pytest.fixture
def i18n():
"""
Set up locale/language/gettext functions. This enables the use of _().
"""
configure_locale_and_language()


@pytest.fixture()
@pytest.fixture
def homedir(i18n):
"""
Create a "homedir" for a client.
Expand All @@ -180,7 +180,7 @@ def homedir(i18n):
return tmpdir


@pytest.fixture()
@pytest.fixture
def mock_export_locked():
"""
Represents the following scenario:
Expand Down Expand Up @@ -211,7 +211,7 @@ def get_status() -> ExportStatus:
return device


@pytest.fixture()
@pytest.fixture
def mock_export_unlocked():
"""
Represents the following scenario:
Expand All @@ -233,7 +233,7 @@ def mock_export_unlocked():
return device


@pytest.fixture()
@pytest.fixture
def mock_export_no_usb_then_bad_passphrase():
"""
Represents the following scenario:
Expand Down Expand Up @@ -266,7 +266,7 @@ def get_status() -> ExportStatus:
return device


@pytest.fixture()
@pytest.fixture
def mock_export_fail_early():
"""
Represents the following scenario:
Expand Down Expand Up @@ -299,7 +299,7 @@ def get_status() -> ExportStatus:
return device


@pytest.fixture()
@pytest.fixture
def functional_test_app_started_context(
vcr_api, homedir, reply_status_codes, session, config, qtbot
):
Expand All @@ -323,7 +323,7 @@ def login_dialog_is_visible():
return (gui, controller)


@pytest.fixture()
@pytest.fixture
def functional_test_logged_in_context(functional_test_app_started_context, qtbot):
"""
Returns a tuple containing the gui window and controller of a configured client after logging in
Expand All @@ -348,7 +348,7 @@ def logged_in():
return (gui, controller)


@pytest.fixture()
@pytest.fixture
def functional_test_offline_context(functional_test_logged_in_context, qtbot):
"""
Returns a tuple containing the gui window and controller of a configured client after making
Expand All @@ -374,12 +374,12 @@ def check_login_button():
return (gui, controller)


@pytest.fixture()
@pytest.fixture
def config(homedir) -> str:
os.environ["SD_SUBMISSION_KEY_FPR"] = "65A1B5FF195B56353CC63DFFCC40EF1228271441"


@pytest.fixture()
@pytest.fixture
def alembic_config(homedir):
return _alembic_config(homedir)

Expand All @@ -401,36 +401,36 @@ def _alembic_config(homedir):
return alembic_path


@pytest.fixture()
@pytest.fixture
def session_maker(homedir):
return make_session_maker(homedir)


@pytest.fixture()
@pytest.fixture
def session(session_maker):
sess = session_maker
Base.metadata.create_all(bind=sess.get_bind(), checkfirst=False)
yield sess
sess.close()


@pytest.fixture()
@pytest.fixture
def reply_status_codes(session) -> None:
for reply_send_status in ReplySendStatusCodes:
reply_status = ReplySendStatus(reply_send_status.value)
session.add(reply_status)
session.commit()


@pytest.fixture()
@pytest.fixture
def download_error_codes(session) -> None:
for download_error_code in DownloadErrorCodes:
download_error = DownloadError(download_error_code.name)
session.add(download_error)
session.commit()


@pytest.fixture()
@pytest.fixture
def source(session) -> dict:
args = {"uuid": str(uuid4()), "public_key": PUB_KEY}
source = Source(
Expand Down Expand Up @@ -473,7 +473,7 @@ def create_gpg_test_context(sdc_home):
)


@pytest.fixture()
@pytest.fixture
def vcr_api(request):
module_group = request.module.__name__.split(".")[1]
library = vcr.VCR(cassette_library_dir=f"tests/{module_group}/data/")
Expand Down
2 changes: 1 addition & 1 deletion client/tests/gui/base/test_dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from securedrop_client.gui.base import ModalDialog


@pytest.fixture()
@pytest.fixture
def modal_dialog(mocker, homedir):
mocker.patch("PyQt5.QtWidgets.QApplication.activeWindow", return_value=QMainWindow())

Expand Down
12 changes: 6 additions & 6 deletions client/tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from tests import factory


@pytest.fixture()
@pytest.fixture
def main_window(mocker, homedir):
# Setup
app = QApplication([])
Expand Down Expand Up @@ -63,7 +63,7 @@ def main_window(mocker, homedir):
app.exit()


@pytest.fixture()
@pytest.fixture
def main_window_no_key(mocker, homedir):
# Setup
app = QApplication([])
Expand Down Expand Up @@ -115,7 +115,7 @@ def main_window_no_key(mocker, homedir):
app.exit()


@pytest.fixture()
@pytest.fixture
def modal_dialog(mocker, homedir):
app = QApplication([])
gui = Window()
Expand Down Expand Up @@ -146,7 +146,7 @@ def modal_dialog(mocker, homedir):
app.exit()


@pytest.fixture()
@pytest.fixture
def mock_export(mocker):
export = Export()

Expand All @@ -164,7 +164,7 @@ def mock_export(mocker):
return export


@pytest.fixture()
@pytest.fixture
def print_dialog(mocker, homedir, mock_export):
app = QApplication([])
gui = Window()
Expand Down Expand Up @@ -198,7 +198,7 @@ def print_dialog(mocker, homedir, mock_export):
app.exit()


@pytest.fixture()
@pytest.fixture
def export_file_wizard(mocker, homedir, mock_export):
app = QApplication([])
gui = Window()
Expand Down
40 changes: 20 additions & 20 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ license = "AGPLv3+"
python = "^3.11"

[tool.poetry.group.dev.dependencies]
ruff = "^0.5.4"
ruff = "^0.6.4"
safety = "*"
shellcheck-py = "*"

Expand Down