epogrebnyak / data-rosstat-kep

Time series dataset of Rosstat Short-term Economic Indicators ("KEP") publication
http://www.gks.ru/wps/wcm/connect/rosstat_main/rosstat/ru/statistics/publications/catalog/doc_1140080765391
6 stars 6 forks source link

Testing: finish test test_mwe.py #57

Closed epogrebnyak closed 8 years ago

epogrebnyak commented 8 years ago

As descibed in todos in https://github.com/epogrebnyak/rosstat-kep-data/blob/master/kep/test/test_mwe.py

alexanderlukanin13 commented 8 years ago

@epogrebnyak In master, test_mwe fails because new column PROD_yoy is added to annual table. Is it correct? Should I modify the test?

epogrebnyak commented 8 years ago

@alexanderlukanin13: test_mwe passes when it is run stand-alone, but fails is a package when many tests are run. The test is good as it is, I cannot see where extra variable PROD_yoy is coming from: in https://github.com/epogrebnyak/rosstat-kep-data/blob/master/kep/test/test_mwe.py#L88 we clean the database. Maybe some cached copy is used in a test, this should be fixed, please give your suggestions.

alexanderlukanin13 commented 8 years ago

@epogrebnyak I investigated sqlite3, pandas and pytest... but finally I saw this: https://github.com/epogrebnyak/rosstat-kep-data/blob/8b73384c49a93b016eaf863d1f4ea3c6582a0e31/kep/database/db.py#L64

epogrebnyak commented 8 years ago

... "I saw this" is not a suggestion, what to do next about it? Best if you tried replicating the tests with cache or without it. Does py.test have errors on your machine?

epogrebnyak commented 8 years ago

I have the test working both stand-alone and (when caching is disabled) - in package.

Note: later may try different import functions for testing and production.