Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ptsavol committed Jun 7, 2024
1 parent e73a226 commit 56321f5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/utils/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,12 @@ def test_resolve_python_interpreter(self):
settings = TestAppSettings("")
p = resolve_python_interpreter(settings)
self.assertEqual(sys.executable, p)
with mock.patch("spine_engine.utils.helpers.is_frozen") as mock_helpers_is_frozen:
mock_helpers_is_frozen.return_value = True
p = resolve_python_interpreter(settings)
self.assertIsNone(p)
mock_helpers_is_frozen.assert_called()
if sys.platform == "win32":
with mock.patch("spine_engine.utils.helpers.is_frozen") as mock_helpers_is_frozen:
mock_helpers_is_frozen.return_value = True
p = resolve_python_interpreter(settings)
self.assertIsNone(p) # This is None only on Win. # FIXME: Find a way to mock is_frozen() in config.py
mock_helpers_is_frozen.assert_called()


class TestAppSettings:
Expand Down

0 comments on commit 56321f5

Please sign in to comment.