robertmartin8 / MachineLearningStocks

Using python and scikit-learn to make stock predictions
MIT License
1.74k stars 506 forks source link

Error en pytest -v #30

Open jordisanchezcarbonell opened 5 years ago

jordisanchezcarbonell commented 5 years ago

tests/test_datasets.py::test_forward_sample_dimensions PASSED [ 11%] tests/test_datasets.py::test_forward_sample_data PASSED [ 22%] tests/test_datasets.py::test_stock_prices_dataset PASSED [ 33%] tests/test_datasets.py::test_stock_prediction_dataset PASSED [ 44%] tests/test_utils.py::test_status_calc PASSED [ 55%] tests/test_utils.py::test_data_string_to_float PASSED [ 66%] tests/test_variables.py::test_statspath PASSED [ 77%] tests/test_variables.py::test_features_same FAILED [ 88%] tests/test_variables.py::test_outperformance PASSED [100%]

=================================================== FAILURES ==================================================== __ test_features_same ___

def test_features_same():
    # There are only four differences (intentionally)
  assert set(parsing_keystats.features) - set(current_data.features) == {'Net Income Avl to Common', 'Qtrly Earnings Growth',

'Qtrly Revenue Growth', 'Shares Short (as of', 'Shares Short (prior month)'} E AssertionError: assert {'Net Income ...Short (as of'} == {'Net Income A...prior month)'} E Extra items in the right set: E 'Shares Short (prior month)' E Full diff: E {'Net Income Avl to Common', E 'Qtrly Earnings Growth', E 'Qtrly Revenue Growth', E - 'Shares Short (as of'}... E
E ...Full output truncated (5 lines hidden), use '-vv' to show

tests/test_variables.py:17: AssertionError ====================================== 1 failed, 8 passed in 11.06 seconds ======================================

xiang-burlington commented 4 years ago

Change parsing_keystats.py as below, re-run everything, that should fix the bug:

@@ -54,7 +54,7 @@ features = [ # Valuation measures "Shares Short (as of", "Short Ratio", "Short % of Float",