Skip to content

Commit 1def3f6

Browse files
BrianWiedercopybara-github
authored andcommitted
chore: Make DateTime mock extend datetime.datetime (which it is mocking).
This makes sure that the mocked `datetime.datetime` has the same attributes as `datetime.datetime`, but with `now` mocked. PiperOrigin-RevId: 577220344
1 parent 0b825c9 commit 1def3f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/unit/aiplatform/test_metadata_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575

7676
@pytest.fixture
7777
def mock_datetime_now(monkeypatch):
78-
class DateTime:
78+
class DateTime(datetime.datetime):
7979
@classmethod
8080
def now(cls):
8181
return _TEST_DATETIME

0 commit comments

Comments
 (0)