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

Fix tests for compatibility with Python 3.12 (backport #5432) #5433

Merged
merged 2 commits into from
Jul 22, 2023
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
3 changes: 3 additions & 0 deletions bodhi-client/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ include = [
]
exclude = ["docs/_build"]

[tool.poetry.build]
generate-setup-file = true

[tool.poetry.dev-dependencies]
Sphinx = ">=3.4.3"
pytest = ">=6.0.0"
Expand Down
3 changes: 3 additions & 0 deletions bodhi-messages/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ include = [
{ path = "COPYING", format = "sdist" }
]

[tool.poetry.build]
generate-setup-file = true

[tool.poetry.dependencies]
python = ">=3.8, <4"
fedora-messaging = ">=3.0.0"
Expand Down
3 changes: 3 additions & 0 deletions bodhi-server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ exclude = [
{ path = "docs/_build", format = "sdist" }
]

[tool.poetry.build]
generate-setup-file = true

[tool.poetry.dev-dependencies]
bodhi-messages = {path = "../bodhi-messages"}
pytest = ">=6.2.2"
Expand Down
2 changes: 1 addition & 1 deletion bodhi-server/tests/consumers/test_signed.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,4 @@ def test_consume_from_tag_composed_by_bodhi(self, add_tag):
assert update.status == UpdateStatus.pending
assert update.pushed is False
assert update.test_gating_status == TestGatingStatus.passed
assert add_tag.not_called()
add_tag.assert_not_called()
2 changes: 1 addition & 1 deletion bodhi-server/tests/tasks/test_approve_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ def test_autotime_update_zero_day_in_testing_no_gated_gets_pushed_to_rawhide(

assert add_tag.call_args_list == \
[call('f17-updates')]
assert delete_tag.not_called()
delete_tag.assert_not_called()
else:
assert remove_tag.call_args_list == \
[call(f'{from_side_tag}-signing-pending'),
Expand Down
4 changes: 2 additions & 2 deletions bodhi-server/tests/tasks/test_composer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3380,9 +3380,9 @@ def test_stable_update(self, delete_tag, from_side_tag):
assert (now - update.date_pushed) < datetime.timedelta(seconds=5)
assert update.pushed
if from_side_tag:
assert delete_tag.called_with('f34-build-side-0000')
delete_tag.assert_called_with('f34-build-side-0000')
else:
assert delete_tag.not_called()
delete_tag.assert_not_called()

def test_testing_update(self):
"""Assert that a testing update gets the right status."""
Expand Down
4 changes: 3 additions & 1 deletion bodhi-server/tests/test_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ def test_validate_acls_pagure_committers_exception(self, warning, mock_gpcfp, mo
assert len(mock_request.errors) == 0
mock_access.assert_called_once()
mock_gpcfp.assert_called_once()
warning.called_once_with('Unable to retrieve committers list from Pagure for bodhi.')
warning.assert_called_once_with(
'Unable to retrieve committers list from Pagure for bodhi.'
)

@mock.patch.dict('bodhi.server.validators.config', {'acl_system': 'dummy'})
def test_validate_acls_dummy(self):
Expand Down
Loading