Skip to content

Commit

Permalink
Merge pull request #10 from nicoddemus/fix-num-regression-test
Browse files Browse the repository at this point in the history
Set display.max_columns in num_regression to prevent truncated output
  • Loading branch information
nicoddemus authored Oct 11, 2018
2 parents 92db928 + d367c71 commit ca307e4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
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

0 comments on commit ca307e4

Please sign in to comment.