Fix Windows UTF-8 decoding issues in sample JSON tests #524
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When running tests on a Windows machine the scatter chart and area chart tests fail when attempting to load sample json, due to encoding issues.
Specifying encoding as utf-8 fixes the problem.
Example fail
======================================================================== FAILURES ========================================================================= __________________________________________________________ TestAreaChartGet.test_get_tate_sample __________________________________________________________ tests\integration\test_area_chart.py:268: in test_get_tate_sample sample_json = load_sample_json("tate.json") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tests\integration\test_area_chart.py:17: in load_sample_json return json.load(f) ^^^^^^^^^^^^ C:\Python313\Lib\json_init_.py:293: in load return loads(fp.read(), ^^^^^^^^^ C:\Python313\Lib\encodings\cp1252.py:23: in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 9330: character maps to <undefined> ================================================================= short test summary info ================================================================= FAILED tests/integration/test_area_chart.py::TestAreaChartGet::test_get_tate_sample - UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 9330: character maps to <undefined> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ============================================================= 1 failed, 177 passed in 20.54s ==============================================================