Skip to content

pandas.test() issue when run from a development instance of pandas #12285

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

Closed
clembou opened this issue Feb 10, 2016 · 2 comments
Closed

pandas.test() issue when run from a development instance of pandas #12285

clembou opened this issue Feb 10, 2016 · 2 comments
Labels
Testing pandas testing functions or related to the test suite
Milestone

Comments

@clembou
Copy link

clembou commented Feb 10, 2016

as described in #11913 (comment),
when using a development pandas instance, if pandas.test() is called while the working directory of the python interpreter is within the pandas repository, it fails to detect any tests, at least on windows:

[pandas_dev] C:\Users\jahfe_000\Documents\GitHub\pandas>python
Python 2.7.11 |Continuum Analytics, Inc.| (default, Jan 29 2016, 14:26:21) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import pandas
>>> pandas.test()
Running unit tests for pandas
pandas version 0.17.1+311.g70f79ce
numpy version 1.10.4
pandas is installed in pandas
Python version 2.7.11 |Continuum Analytics, Inc.| (default, Jan 29 2016, 14:26:21) [MSC v.1500 64 bit (AMD64)]
nose version 1.3.7

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
<nose.result.TextTestResult run=0 errors=0 failures=0>
>>>

if using python setup.py develop, a fix is to browse to a folder outside of the repo:

[pandas_dev] C:\Users\jahfe_000\Documents\GitHub\pandas>cd ..

[pandas_dev] C:\Users\jahfe_000\Documents\GitHub>python
Python 2.7.11 |Continuum Analytics, Inc.| (default, Jan 29 2016, 14:26:21) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import pandas
>>> pandas.test()
Running unit tests for pandas
pandas version 0.17.1+311.g70f79ce
numpy version 1.10.4
pandas is installed in c:\users\jahfe_000\documents\github\pandas\pandas
Python version 2.7.11 |Continuum Analytics, Inc.| (default, Jan 29 2016, 14:26:21) [MSC v.1500 64 bit (AMD64)]
nose version 1.3.7
C:\Anaconda\envs\pandas_dev\lib\site-packages\matplotlib\backends\qt_compat.py:84: ImportWarning: Not importing directory 'C:\Anaconda\envs\pandas_dev\sip': missing __init__.py
  import sip
....................................S..............S..............S..............S.................F.........................................................................................................................................................

This seems to be due to the fact that pandas.__file__ returns a relative path from the package root when accessed from a folder located within the package, and a relative path when accessed from any other directory.

@jreback jreback added Testing pandas testing functions or related to the test suite Difficulty Intermediate labels Feb 10, 2016
@jreback jreback added this to the 0.18.1 milestone Feb 10, 2016
@clembou
Copy link
Author

clembou commented Feb 11, 2016

Well, I tried to fix the problem but I am afraid I have to give up.

First of all, this is pretty hard to debug as I can't reproduce the problem in pycharm, only in the command line interpreter. By increasing the verbosity of the nose test runner pd.test(verbose=4) - This line needs to be modified to allow this - I came to the conclusion that the problem was coming from nose itself, most likely in nose/importer.py. This file uses __file__ and __path__ extensively and must be affected by the absolute/relative path problem.

Unfortunately I haven't managed to track the bug down fully. If someone has experience with nose and module imports they will probably figure this out!

@jreback
Copy link
Contributor

jreback commented Apr 18, 2016

pls reopen if this persists. I cannot reprod.

@jreback jreback closed this as completed Apr 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

No branches or pull requests

2 participants