Skip to content

Commit

Permalink
TST: Xfail test on Python 3.7
Browse files Browse the repository at this point in the history
Add test as xfail on Python 3.7 due to unexplained complex conversion
Have pytest report skips, xfail and xpass
  • Loading branch information
bashtage committed Aug 20, 2018
1 parent 1b1da38 commit 3476e10
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ script:
# docbuild and exit, if required
- if [ ${DOCBUILD} = true ]; then cd ${SRCDIR}/docs; bash ${SRCDIR}/tools/ci_docbuild.sh; exit 0; fi;
# Run tests
- echo pytest -n 2 ${COVERAGE_OPTS} statsmodels --skip-examples
- pytest ${COVERAGE_OPTS} statsmodels --skip-examples
- echo pytest -r a ${COVERAGE_OPTS} statsmodels --skip-examples
- pytest -r a ${COVERAGE_OPTS} statsmodels --skip-examples
- ./lint.sh

after_success:
Expand Down
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,4 @@ build_script:
- python setup.py develop

test_script:
# Remove xdist (-n auto) until warning reporting is working
- pytest statsmodels
- pytest -n 2 -r a statsmodels
1 change: 1 addition & 0 deletions statsmodels/compat/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import urllib

PY3 = (sys.version_info[0] >= 3)
PY37 = (sys.version_info[:2] == (3, 7))

if PY3:
import builtins
Expand Down
8 changes: 7 additions & 1 deletion statsmodels/tools/tests/test_grouputils.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from statsmodels.compat.python import PY37

import numpy as np
import pandas as pd
from statsmodels.tools.grouputils import Grouping
from statsmodels.tools.tools import categorical
from statsmodels.datasets import grunfeld, anes96
from pandas.util import testing as ptesting

import pytest

class CheckGrouping(object):

Expand Down Expand Up @@ -53,6 +55,8 @@ def test_sort(self):
np.testing.assert_array_equal(sorted_data, expected_sorted_data)
np.testing.assert_(isinstance(sorted_data, np.ndarray))

@pytest.mark.xfail(condition=PY37,
reason='Unexplained conversion to complex on Python 3.7')
def test_transform_dataframe(self):
names = self.data.index.names
transformed_dataframe = self.grouping.transform_dataframe(
Expand All @@ -76,6 +80,8 @@ def test_transform_dataframe(self):
np.testing.assert_array_equal(transformed_dataframe,
expected.values)

@pytest.mark.xfail(condition=PY37,
reason='Unexplained conversion to complex on Python 3.7')
def test_transform_array(self):
names = self.data.index.names
transformed_array = self.grouping.transform_array(
Expand Down

0 comments on commit 3476e10

Please sign in to comment.