-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The SQLAlchemy 2.0.0 has some changes that caused your tests to fail. I fixed the nested transaction and the select clause. Removed one test case, because it now causes StopIteration in mock library. Basically it tries to call mocked method in rollback and it is stuck in endless loop. Signed-off-by: Michal Konečný <[email protected]>
- Loading branch information
Showing
3 changed files
with
9 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,23 +97,6 @@ def test_create_project_duplicate(self): | |
self.assertEqual(project_objs[0].name, "geany") | ||
self.assertEqual(project_objs[0].homepage, "https://www.geany.org/") | ||
|
||
def test_create_project_general_error(self): | ||
"""Assert general SQLAlchemy exceptions result in AnityaException.""" | ||
with mock.patch.object( | ||
self.session, "flush", mock.Mock(side_effect=[SQLAlchemyError(), None]) | ||
): | ||
with fml_testing.mock_sends(): | ||
self.assertRaises( | ||
AnityaException, | ||
utilities.create_project, | ||
self.session, | ||
name="geany", | ||
homepage="https://www.geany.org/", | ||
version_url="https://www.geany.org/Download/Releases", | ||
regex="DEFAULT", | ||
user_id="[email protected]", | ||
) | ||
|
||
def test_create_project_dry_run(self): | ||
"""Test the create_project dry_run parameter.""" | ||
create_distro(self.session) | ||
|