TST/CI: make sure that locales are tested
State: closed

related #4918


Labels:

Comments:
we pass on these? so #4918 can close? (or maybe have him retest, AFAIK all the other issues are resolved)

~~yep passes~~

was not writing to the init file bc duh i should write directly to pandas repo, not after it's installed

i'm actually doing what @Komnomnomnom did to repro the issue by setting the locale in Python at the top of `pandas/__init__.py` after install 

@jreback getting those errors

py26: https://travis-ci.org/cpcloud/pandas/jobs/12032903

also some new errors show up in the slow build

https://travis-ci.org/cpcloud/pandas/jobs/12032904

guess the locale wasn't really being set before

gr8!

do you know why the google tests are failing?

no...will also require some digging 

@avalentino can you test again when you get a chance? thanks.

> @avalentino can you test again when you get a chance? thanks.

Just one error remaining

```
$ git describe 
v0.12.0-781-gde4cd21

$ nosetests -w pandas
[...]

======================================================================
ERROR: test_url (pandas.io.tests.test_json.test_pandas.TestPandasContainer)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/antonio/pandas-venv/pandas/pandas/util/testing.py", line 1061, in network_wrapper
    return t(*args, **kwargs)
  File "/home/antonio/pandas-venv/pandas/pandas/io/tests/test_json/test_pandas.py", line 577, in test_url
    result = read_json(url)
  File "/home/antonio/pandas-venv/pandas/pandas/io/json.py", line 189, in read_json
    date_unit).parse()
  File "/home/antonio/pandas-venv/pandas/pandas/io/json.py", line 257, in parse
    self._parse_no_numpy()
  File "/home/antonio/pandas-venv/pandas/pandas/io/json.py", line 474, in _parse_no_numpy
    loads(json, precise_float=self.precise_float), dtype=None)
ValueError: Expected object or value
-------------------- >> begin captured stdout << ---------------------
Failed: ValueError('Expected object or value',)

--------------------- >> end captured stdout << ----------------------

----------------------------------------------------------------------
Ran 4022 tests in 128.509s

FAILED (SKIP=259, errors=1)
```

cc @Komnomnomnom  can you give a quick look, this is in a non-us locale: `it_IT.UTF-8`

I think this is a problem with the test, I consistently get:

```
➜ nosetests -vs pandas.io.tests.test_json.test_pandas:TestPandasContainer.test_url                                            [py27]  git:(16035df) ✗
test_url (pandas.io.tests.test_json.test_pandas.TestPandasContainer) ... SKIP: Skipping test HTTP Error 410: Gone
```

The test requests data from `http://search.twitter.com/search.json?q=pandas%20python` but it looks like this is no longer valid, sticking it in a browser results in:

``` json
{"errors": [{"message": "The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.", "code": 68}]}
```

and according to the twitter docs 

> In version 1.1, we're requiring applications to authenticate all of their requests with OAuth 1.0a or Application-only authentication.

So 

1 I'm not sure @avalentino why you aren't seeing the SKIP, it does look like JSON is being passed an empty string in your case:

``` python
In [2]: pd.read_json('')
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-2-2bbdc38cf707> in <module>()
----> 1 pd.read_json('')

ValueError: Expected object or value
```

2 @jreback, @cpcloud what do you want to do with this test (I'm not the original author). Remove it or find a different url?

FYI the test passes for me (in it_IT locale) if I remove the twitter request (it's already sending a request to github anyway and it doesn't even check the twitter result so it's pretty redundant regardless).

couldn't we use this?

http://www.jsontest.com/

yep that looks good ... i'll update the test

actually nvm we can just remove the twitter ... it's already being tested with github's API

@jreback @jtratner comments? want to get this in ...

looks ok to me
big changes!

@avalentino Can u give this another go and see if anything turns up? Thanks

nothing crazy here just cleaning up a bit of rot in the CI stuff and `test_pandas/test_json.py` tests