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

Error and failure in nosetests (Ubuntu 12.04) #1361

Closed
gerigk opened this issue May 31, 2012 · 9 comments
Closed

Error and failure in nosetests (Ubuntu 12.04) #1361

gerigk opened this issue May 31, 2012 · 9 comments
Labels
Bug Testing pandas testing functions or related to the test suite
Milestone

Comments

@gerigk
Copy link

gerigk commented May 31, 2012

======================================================================
ERROR: test_map (pandas.tseries.tests.test_period.TestPeriodIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/arthur/python-packages/pandas/pandas/tseries/tests/test_period.py", line 1523, in test_map
    assert_array_equal(result, expected)
  File "/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 753, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 612, in assert_array_compare
    x_isnan[x_isna] = False
  File "/home/arthur/python-packages/pandas/pandas/core/index.py", line 282, in __setitem__
    raise Exception(str(self.__class__) + ' object is immutable')
Exception: <class 'pandas.tseries.period.PeriodIndex'> object is immutable

======================================================================
FAIL: test_unicode_index (pandas.io.tests.test_pytables.TestHDFStore)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/arthur/python-packages/pandas/pandas/io/tests/test_pytables.py", line 661, in test_unicode_index
    self._check_roundtrip(s, tm.assert_series_equal)
  File "/home/arthur/python-packages/pandas/pandas/io/tests/test_pytables.py", line 566, in _check_roundtrip
    comparator(retrieved, obj, **kwargs)
  File "/home/arthur/python-packages/pandas/pandas/util/testing.py", line 129, in assert_series_equal
    assert(left.index.equals(right.index))
AssertionError
@changhiskhan
Copy link
Contributor

Can't seem to reproduce on my end.
You're on master with 64-bit OS?

@gerigk
Copy link
Author

gerigk commented May 31, 2012

yes. numpy 1.7 , pytables 2.3.1

@changhiskhan
Copy link
Contributor

assert_array_compare (called by assert_array_equal) was changed in numpy 1.7:

"""
File "/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 612, in assert_array_compare
x_isnan[x_isna] = False
"""

We'll fix before final release.

Thanks for the bug report!

@wesm
Copy link
Member

wesm commented Jun 2, 2012

I did a fresh build and everything passes cleanly now on fresh NumPy 1.7 (git master) + Python 2.7 and PyTables 2.3.1. I worry that the unicode failure might be locale specific, can you help us debug that? You need to run

nosetests pandas/io/tests/test_pytables.py --pdb-failure

then you'll want to copy-paste repr(left.index.values) and right.index.values and any other information you can find out.

@gerigk
Copy link
Author

gerigk commented Jun 2, 2012

This is really weird. First I ran your command...it passed.
Then I ran the whole test suite:

======================================================================
ERROR: test_andrews_curves (pandas.tests.test_graphics.TestDataFramePlots)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/arthur/python-packages/pandas/pandas/tests/test_graphics.py", line 247, in test_andrews_curves
    df = read_csv('data/iris.data')
  File "/home/arthur/python-packages/pandas/pandas/io/parsers.py", line 224, in read_csv
    return _read(TextParser, filepath_or_buffer, kwds)
  File "/home/arthur/python-packages/pandas/pandas/io/parsers.py", line 171, in _read
    f = com._get_handle(filepath_or_buffer, 'r', encoding=encoding)
  File "/home/arthur/python-packages/pandas/pandas/core/common.py", line 852, in _get_handle
    f = open(path, mode)
IOError: [Errno 2] No such file or directory: 'data/iris.data'

======================================================================
FAIL: test_unicode_index (pandas.io.tests.test_pytables.TestHDFStore)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/arthur/python-packages/pandas/pandas/io/tests/test_pytables.py", line 661, in test_unicode_index
    self._check_roundtrip(s, tm.assert_series_equal)
  File "/home/arthur/python-packages/pandas/pandas/io/tests/test_pytables.py", line 566, in _check_roundtrip
    comparator(retrieved, obj, **kwargs)
  File "/home/arthur/python-packages/pandas/pandas/util/testing.py", line 129, in assert_series_equal
    assert(left.index.equals(right.index))
AssertionError

----------------------------------------------------------------------
Ran 2073 tests in 290.640s

and again only the pytables test:

FAILED (SKIP=9, errors=1, failures=1)
arthur@arthur:~/python-packages/pandas$ nosetests pandas/io/tests/test_pytables.py --pdb-failure
.............................................
----------------------------------------------------------------------
Ran 45 tests in 4.521s

OK

@gerigk
Copy link
Author

gerigk commented Jun 2, 2012

so now for the whole thing

'''
arthur@arthur:~/python-packages/pandas$ nosetests --pdb-failure
.........................SSS..........................................................................................> /home/arthur/python-packages/pandas/pandas/util/testing.py(129)assert_series_equal()
-> assert(left.index.equals(right.index))
(Pdb) p repr(left.index.values)
'array([\xcf\x83, \xcf\x83], dtype=object)'
(Pdb) p repr(right.index.values)
'array([\xcf\x83, \xcf\x83\xcf\x83], dtype=object)'
(Pdb) p left
σ 1.011290
σ 1.337302
(Pdb) p right
σ 1.011290
σσ 1.337302

'''

@wesm
Copy link
Member

wesm commented Jun 2, 2012

I made some changes that should do the trick (though I'm debugging blind), can you run the test suite now and see if it works?

@gerigk
Copy link
Author

gerigk commented Jun 3, 2012

Ran 2074 tests in 92.952s

OK (SKIP=9)

Thanks a lot!

@wesm wesm closed this as completed Jun 3, 2012
@richardvancouver
Copy link

I installed pandas and other required packages under python3.4 and ubuntu 14.04 LTS
installed pandas 0.15.2 successfully:
Successfully installed pandas-0.15.2

However, didn't pass 'nosetests pandas'

ERROR: test_read_google (pandas.io.tests.test_data.TestDataReader)

Traceback (most recent call last):
File "/home/rui/venv/ipython-notebook/lib/python3.4/site-packages/pandas/util/testing.py", line 1441, in wrapper
return t(_args, *_kwargs)
File "/home/rui/venv/ipython-notebook/lib/python3.4/site-packages/pandas/io/tests/test_data.py", line 419, in test_read_google
gs = DataReader("GS", "google")
File "/home/rui/venv/ipython-notebook/lib/python3.4/site-packages/pandas/io/data.py", line 81, in DataReader
retry_count=retry_count, pause=pause)
File "/home/rui/venv/ipython-notebook/lib/python3.4/site-packages/pandas/io/data.py", line 441, in get_data_google
adjust_price, ret_index, chunksize, 'google')
File "/home/rui/venv/ipython-notebook/lib/python3.4/site-packages/pandas/io/data.py", line 353, in _get_data_from
hist_data = src_fn(symbols, start, end, retry_count, pause)
File "/home/rui/venv/ipython-notebook/lib/python3.4/site-packages/pandas/io/data.py", line 221, in _get_hist_google
return _retry_read_url(url, retry_count, pause, 'Google')
File "/home/rui/venv/ipython-notebook/lib/python3.4/site-packages/pandas/io/data.py", line 177, in _retry_read_url
"return a 200 for url %r" % (retry_count, name, url))
OSError: after 3 tries, Google did not return a 200 for url 'http://www.google.com/finance/historical?startdate=Jan+01%2C+2010&output=csv&enddate=Dec+28%2C+2014&q=GS'

FAIL: test_wdi_download (pandas.io.tests.test_wb.TestWB)

Traceback (most recent call last):
File "/home/rui/venv/ipython-notebook/lib/python3.4/site-packages/pandas/util/testing.py", line 1441, in wrapper
return t(_args, *_kwargs)
File "/home/rui/venv/ipython-notebook/lib/python3.4/site-packages/pandas/io/tests/test_wb.py", line 48, in test_wdi_download
assert_frame_equal(result, pandas.DataFrame(expected))
File "/home/rui/venv/ipython-notebook/lib/python3.4/site-packages/pandas/util/testing.py", line 730, in assert_frame_equal
check_exact=check_exact)
File "/home/rui/venv/ipython-notebook/lib/python3.4/site-packages/pandas/util/testing.py", line 674, in assert_series_equal
assert_almost_equal(left.values, right.values, check_less_precise)
File "das/src/testing.pyx", line 58, in pandas._testing.assert_almost_equal (pandas/src/testing.c:2740)
File "das/src/testing.pyx", line 93, in pandas._testing.assert_almost_equal (pandas/src/testing.c:1825)
File "das/src/testing.pyx", line 140, in pandas._testing.assert_almost_equal (pandas/src/testing.c:2572)
AssertionError: expected 39682.47225 but got 39677.30176, with decimal 5

FAIL: test_now (pandas.tseries.tests.test_tslib.TestTimestamp)

Traceback (most recent call last):
File "/home/rui/venv/ipython-notebook/lib/python3.4/site-packages/pandas/tseries/tests/test_tslib.py", line 328, in test_now
self.assertTrue((ts_from_string_tz.tz_localize(None) - ts_from_string) < delta)
AssertionError: False is not true

FAIL: test_today (pandas.tseries.tests.test_tslib.TestTimestamp)

Traceback (most recent call last):
File "/home/rui/venv/ipython-notebook/lib/python3.4/site-packages/pandas/tseries/tests/test_tslib.py", line 344, in test_today
self.assertTrue((ts_from_string_tz.tz_localize(None) - ts_from_string) < delta)
AssertionError: False is not true


Ran 7582 tests in 552.072s

FAILED (SKIP=604, errors=1, failures=3)

Could you help me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Testing pandas testing functions or related to the test suite
Projects
None yet
Development

No branches or pull requests

4 participants