Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set display.max_columns in num_regression to prevent truncated output #10

Merged
merged 1 commit into from
Oct 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.0.3 (2018-10-10)
------------------

* Set ``pandas`` ``display.max_columns`` option in ``num_regression`` to prevent
``pandas`` from truncating the output (`#3 <https://github.com/ESSS/pytest-regressions/issues/3>`_).


1.0.2 (2018-08-29)
------------------
Expand Down
3 changes: 3 additions & 0 deletions src/pytest_regressions/num_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class NumericRegressionFixture(object):

DISPLAY_PRECISION = 17 # Decimal places
DISPLAY_WIDTH = 1000 # Max. Chars on outputs
DISPLAY_MAX_COLUMNS = 1000 # Max. Number of columns (see #3)

def __init__(self, datadir, original_datadir, request):
"""
Expand All @@ -32,6 +33,8 @@ def __init__(self, datadir, original_datadir, request):
NumericRegressionFixture.DISPLAY_PRECISION,
"display.width",
NumericRegressionFixture.DISPLAY_WIDTH,
"display.max_columns",
NumericRegressionFixture.DISPLAY_MAX_COLUMNS,
)

def _check_data_types(self, key, obtained_column, expected_column):
Expand Down
1 change: 0 additions & 1 deletion tests/test_num_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def compare_arrays(obtained, expected):
)


@pytest.mark.xfail(reason="#3 needs investigation", strict=True)
def test_common_cases(num_regression, no_regen):
# Most common case: Data is valid, is present and should pass
data1 = 1.1 * np.ones(5000)
Expand Down