s-leroux / fin

Set of tools for personal investment
MIT License
1 stars 0 forks source link

Unicode characters break the test runner on GitHub #37

Closed s-leroux closed 2 months ago

s-leroux commented 3 months ago

Unicode characters break the test runner on GitHub.

The example below was caused by '…' (\u2026) in the heading while printing a Serie instance.

======================================================================
ERROR: test_adj (tests.fin.seq.fc.test_adj.TestAdjustQuote)
<class 'fin.model.solvers.particle.ParticleSwarmSolver'> Use case #1 4.565761130040028e-16 (3.9999999928003915, 7.999999995255896)
<class 'fin.model.solvers.random.RandomSolver'> Use case #1 0.05296359406606747 (4.078120375554134, 8.045150938464865)
<class 'fin.model.solvers.particle.ParticleSwarmSolver'> Use case #2 2.3216148996009935e-18 (2.0000000009396457, 2.9999999995592344)
<class 'fin.model.solvers.random.RandomSolver'> Use case #2 0.02055660096305517 (1.9510313914860744, 3.0927051599569175)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/__w/fin/fin/tests/fin/seq/fc/test_adj.py", line 32, in test_adj
    print(res)
UnicodeEncodeError: 'ascii' codec can't encode character '\u2026' in position 7: ordinal not in range(128)

----------------------------------------------------------------------
Ran 206 tests in 1.765s
s-leroux commented 2 months ago

Fixed by 95e9e81efd08647af0f4be2fba318b38d4b9983e.