Skip to content

Commit f05a90f

Browse files
author
Chris Rossi
authored
Clean up usage of object.__new__ and mocks for Model in unit tests (#177)
Fixes #6
1 parent be0ab71 commit f05a90f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/google-cloud-ndb/tests/unit/test_model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,7 @@ def test_invalid_value():
13261326
@pytest.mark.usefixtures("in_context")
13271327
def test_unchecked_model_type():
13281328
value = model.Key("This", 1)
1329-
entity = object.__new__(model.Model)
1329+
entity = model.Model()
13301330

13311331
result = model._validate_key(value, entity=entity)
13321332
assert result is value
@@ -1335,7 +1335,7 @@ def test_unchecked_model_type():
13351335
@pytest.mark.usefixtures("in_context")
13361336
def test_unchecked_expando_type():
13371337
value = model.Key("This", 1)
1338-
entity = object.__new__(model.Expando)
1338+
entity = model.Expando()
13391339

13401340
result = model._validate_key(value, entity=entity)
13411341
assert result is value
@@ -1408,7 +1408,7 @@ def test__validate_wrong_type():
14081408
@staticmethod
14091409
@pytest.mark.usefixtures("in_context")
14101410
def test__set_value():
1411-
entity = object.__new__(model.Model)
1411+
entity = model.Model()
14121412
value = key_module.Key("Map", 8898)
14131413

14141414
model.ModelKey._set_value(entity, value)

0 commit comments

Comments
 (0)