Skip to content

Commit

Permalink
Formatting; Fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrugman committed Jan 2, 2020
1 parent 6494ce4 commit ed6cd26
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
1 change: 0 additions & 1 deletion pandas_profiling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ def default(self, o):

return json.dumps(self.description_set, indent=4, cls=CustomEncoder)


def _repr_html_(self):
"""Used to output the HTML representation to a Jupyter notebook.
When config.notebook.iframe.attribute is "src", this function creates a temporary HTML file
Expand Down
2 changes: 1 addition & 1 deletion pandas_profiling/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __getitem__(self, item):

def __setitem__(self, key, value):
self.config[key].set(value)

def dump(self):
return self.config.dump()

Expand Down
5 changes: 4 additions & 1 deletion pandas_profiling/model/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ class Message(object):
"""A message object (type, values, column)."""

def __init__(
self, message_type: MessageType, values: dict, column_name: Union[str, None] = None
self,
message_type: MessageType,
values: dict,
column_name: Union[str, None] = None,
):
self.message_type = message_type
self.values = values
Expand Down
11 changes: 8 additions & 3 deletions tests/unit/test_describe.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,9 +627,14 @@ def test_describe_df(describe_data, expected_results):

results = describe(describe_data_frame)

assert {"table", "variables", "correlations", "missing", "messages"} == set(
results.keys()
), "Not in results"
assert {
"table",
"variables",
"correlations",
"missing",
"messages",
"package",
} == set(results.keys()), "Not in results"
assert set(
{
"CAT": 1,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_example(tmpdir):
assert (tmpdir / "profile.html").exists(), "Output file does not exist"
assert (
type(profile.get_description()) == dict
and len(profile.get_description().items()) == 5
and len(profile.get_description().items()) == 6
), "Unexpected result"
assert set(profile.get_rejected_variables(0.9)) == {
"reclat_city"
Expand Down

0 comments on commit ed6cd26

Please sign in to comment.