Skip to content

Commit

Permalink
Properly mock sys.version to avoid test contamination.
Browse files Browse the repository at this point in the history
  • Loading branch information
rtibbles committed Jul 2, 2024
1 parent 0c684a6 commit ed9012b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tests/testapp/tests/test_uuid_utilities.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import hashlib
import sys
import uuid

import mock
Expand Down Expand Up @@ -100,6 +99,7 @@ def test_same_node_id(self):
@mock.patch("platform.platform", return_value="Windows 3.1")
@mock.patch("platform.node", return_value="myhost")
@mock.patch("morango.models.utils._get_database_path", return_value="<dummypath>")
@mock.patch('sys.version', '2.7.333')
def test_consistent_with_0_4_instance_id_calculation(self, *args):
"""
This test ensures that we don't accidentally make changes that impact how we calculate
Expand All @@ -108,8 +108,6 @@ def test_consistent_with_0_4_instance_id_calculation(self, *args):

from morango.models.utils import _get_database_path

sys.version = "2.7.333"

DatabaseIDModel.objects.all().update(current=False)
database_id = DatabaseIDModel.objects.create(
id="6fe445b75cea11858c00fb97bdee8878", current=True
Expand Down

0 comments on commit ed9012b

Please sign in to comment.