[tests] test_runner - check unicode #10222

pull jnewbery wants to merge 1 commits into bitcoin:master from jnewbery:test_runner_check_unicode changing 1 files +11 −3
  1. jnewbery commented at 6:17 PM on April 17, 2017: member

    #10159 added unicode check/cross/circle glyphs to the test results. This is usually fine, but if Python' stdout can't print unicode, then test_runner will throw an error and not print the results:

     File "./test/functional/test_runner.py", line 482, in <module>
       main()
     File "./test/functional/test_runner.py", line 244, in main
       run_tests(test_list, config["environment"]["SRCDIR"], config["environment"]["BUILDDIR"], config["environment"]["EXEEXT"], args.jobs, args.coverage, passon_args)
     File "./test/functional/test_runner.py", line 288, in run_tests
       print_results(test_results, max_len_name, (int(time.time() - time0)))
     File "./test/functional/test_runner.py", line 316, in print_results
       print(results)
    UnicodeEncodeError: 'ascii' codec can't encode character '\u2713' in position 104: ordinal not in range(128)
    

    This change only prints the glyphs if stdout supports unicode, and replaces them with a letter otherwise:

    with unicode:

    screenshot from 2017-04-17 14-14-54

    without:

    screenshot from 2017-04-17 14-17-02

    First reported by @TheBlueMatt

  2. [tests] test_runner - check unicode a97ed80f97
  3. paveljanik commented at 6:26 PM on April 17, 2017: contributor

    What about small "v" instead of "P"?

  4. jtimon commented at 6:26 PM on April 17, 2017: contributor

    utACK a97ed80f97a7572f084f1381837f96d6f0cbb569

  5. TheBlueMatt commented at 6:30 PM on April 17, 2017: member

    ACK. Fixed test_runner for me.

  6. jnewbery commented at 6:43 PM on April 17, 2017: member

    @paveljanik the idea is for the characters to be as distinct as possible so it's easy to scan down the list and quickly see if there's a line with a different character (the glyphs were originally added for monochrome terminals where text coloring doesn't help). Small v is too similar to small x.

  7. paveljanik commented at 6:46 PM on April 17, 2017: contributor

    @jnewbery Fair enough. But P is almost similar to o... In this regard, I think that "v" is much better (and it is also similar to "✓").

  8. MarcoFalke commented at 7:52 PM on April 17, 2017: member

    utACK a97ed80

  9. MarcoFalke merged this on Apr 17, 2017
  10. MarcoFalke closed this on Apr 17, 2017

  11. MarcoFalke referenced this in commit 6ce733747e on Apr 17, 2017
  12. jnewbery deleted the branch on Apr 17, 2017
  13. paveljanik commented at 5:29 AM on April 18, 2017: contributor

    @jnewbery Hmm, it got merged in the middle of our conversation 8) What do you think about P and o similarity? Just have a look at your second picture...

  14. jnewbery commented at 1:36 PM on April 18, 2017: member

    @paveljanik thanks for taking the time to think about and review this. I see your point about o/P being similar, but I really think that they're more distinguishable than x/v. I'm also more interested in the symbol for failure being distinguishable from the symbol for success. The times this is most useful is when there's a list of succeeding test cases with one or a few failing test cases, so the x symbol should be instantly distinguishable from the P symbol.

  15. paveljanik commented at 1:53 PM on April 18, 2017: contributor

    Yes, it is optimized for the most frequent use case. Agreed. Thank you for explanation.

  16. PastaPastaPasta referenced this in commit 21b28fd1fa on Jun 10, 2019
  17. PastaPastaPasta referenced this in commit aeec5120d9 on Jun 11, 2019
  18. PastaPastaPasta referenced this in commit 82ac2b370b on Jun 11, 2019
  19. PastaPastaPasta referenced this in commit db08107238 on Jun 15, 2019
  20. PastaPastaPasta referenced this in commit fc5e461eeb on Jun 18, 2019
  21. PastaPastaPasta referenced this in commit 59f4c84e07 on Jun 19, 2019
  22. barrystyle referenced this in commit 2bc708fe58 on Jan 22, 2020
  23. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-30 12:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me