Skip to content

Commit

Permalink
Fix integration tests (#3953)
Browse files Browse the repository at this point in the history
* Fix integration tests

* Update changelog.md

* Update changelog.md

* Bump up contributor note to 1.0.0

Co-authored-by: Jeremy Cohen <jeremy@dbtlabs.com>
  • Loading branch information
kadero and jtcohen6 committed Sep 29, 2021
1 parent 38eb46d commit c25b7a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Contributors:

- [@dave-connors-3](https://github.com/dave-connors-3) ([#3920](https://github.com/dbt-labs/dbt/issues/3920))

- [@kadero](https://github.com/kadero) ([#3952](https://github.com/dbt-labs/dbt/issues/3952))

## dbt 0.21.0 (Release TBD)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ def _snapshot_and_assert_invalidated(self):
for result in snapshotted[10:]:
# result is a tuple, the dbt_valid_to column is the latest
self.assertIsInstance(result[-1], datetime)
self.assertGreaterEqual(result[-1].astimezone(pytz.UTC), self._invalidated_snapshot_datetime)
self.assertGreaterEqual(result[-1].replace(tzinfo=pytz.UTC), self._invalidated_snapshot_datetime)

def _revive_records(self):
database = self.default_database
Expand Down Expand Up @@ -946,7 +946,7 @@ def _snapshot_and_assert_revived(self):
for result in invalidated_records:
# result is a tuple, the dbt_valid_to column is the latest
self.assertIsInstance(result[1], datetime)
self.assertGreaterEqual(result[1].astimezone(pytz.UTC), self._invalidated_snapshot_datetime)
self.assertGreaterEqual(result[1].replace(tzinfo=pytz.UTC), self._invalidated_snapshot_datetime)

# records which weren't revived (id != 10, 11)
revived_records = self.run_sql(
Expand All @@ -968,5 +968,5 @@ def _snapshot_and_assert_revived(self):
self.assertIsInstance(result[1], datetime)
# there are milliseconds (part of microseconds in datetime objects) in the
# invalidated_snapshot_datetime and not in result datetime so set the microseconds to 0
self.assertGreaterEqual(result[1].astimezone(pytz.UTC), self._invalidated_snapshot_datetime.replace(microsecond=0))
self.assertGreaterEqual(result[1].replace(tzinfo=pytz.UTC), self._invalidated_snapshot_datetime.replace(microsecond=0))
self.assertIsNone(result[2])

0 comments on commit c25b7a1

Please sign in to comment.