forked from datahub-project/datahub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ingest): bigquery-beta - Adding python 3.8 fix for memory footpri…
…nt util (datahub-project#6228)
- Loading branch information
Showing
2 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
metadata-ingestion/tests/unit/utilities/test_memory_footprint.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from collections import defaultdict | ||
|
||
from datahub.utilities import memory_footprint | ||
|
||
|
||
def test_total_size_with_empty_dict(): | ||
size = memory_footprint.total_size({}) | ||
# Only asserting if it is bigger than 0 because the actual sizes differs per python version | ||
assert size > 0 | ||
|
||
|
||
def test_total_size_with_list(): | ||
size = memory_footprint.total_size({"1": [1, 2, 3, 4]}) | ||
# Only asserting if it is bigger than 0 because the actual sizes differs per python version | ||
assert size > 0 | ||
|
||
|
||
def test_total_size_with_none(): | ||
size = memory_footprint.total_size(None) | ||
# Only asserting if it is bigger than 0 because the actual sizes differs per python version | ||
assert size > 0 | ||
|
||
|
||
def test_total_size_with_defaultdict(): | ||
size = memory_footprint.total_size(defaultdict) | ||
# Only asserting if it is bigger than 0 because the actual sizes differs per python version | ||
assert size > 0 |