Test for statistics is failing under Python 2.7
See original GitHub issue$ source activate py27
prepending //anaconda/envs/py27/bin to PATH
((py27)) pc:femto femto$ python qstrader/statistics/statistics_test.py
//anaconda/envs/py27/lib/python2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')
//anaconda/envs/py27/lib/python2.7/site-packages/IPython/html.py:14: ShimWarning: The `IPython.html` package has been deprecated. You should import from `notebook` instead. `IPython.html.widgets` has moved to `ipywidgets`.
"`IPython.html.widgets` has moved to `ipywidgets`.", ShimWarning)
F
======================================================================
FAIL: test_calculating_statistics (__main__.TestSimpleStatistics)
----------------------------------------------------------------------
Traceback (most recent call last):
File "qstrader/statistics/statistics_test.py", line 159, in test_calculating_statistics
self.assertEqual(results["sharpe"], Decimal("1.8353"))
AssertionError: 1.8353 != Decimal('1.8353')
----------------------------------------------------------------------
Ran 1 test in 0.099s
FAILED (failures=1)
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
test_ssl.py and test_urllib2.py tests are failing in python2.7
tests failed due to missing python module libpython2.7-testsuite.
Read more >1034712 – [python27] test failure in python test_urllib
Two tests in test_urllib fail. Output from the brew build log [1]: test_urllib failed -- Traceback (most recent call last): File ...
Read more >Common migration problems — Supporting Python 3
In Python 3 the test would always fail, as you need to compare with a bytes object instead. If you don't need Python...
Read more >Porting Python 2 Code to Python 3 — Python 3.11.1 ...
With Python 3 being the future of Python while Python 2 is still in active use, ... code knowing that any tests which...
Read more >Getting Started With Testing in Python
In this in-depth tutorial, you'll see how to create Python unit tests, ... Is the car's computer failing? ... Ran 2 tests in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This test can be run using
Hum… bad idea… because it’s failling now under Python 3 (and not under Python 2!)