1. 21 Jul, 2020 3 commits
    • Manuel Jacob's avatar
      tests: port from nosetests to pytest · d843f9a62e6e
      Manuel Jacob authored
      Nosetests is not actively developed anymore. Pytest is actively developed and
      has a much larger ecosystem around it.
      Two features of pytest are particularly helpful for us:
      Pytest captures stdio by redirecting at the file descriptor-level instead of
      replacing sys.stdout. This is required for Mercurial, as it has its own
      reference to stdout. Before with nosetests, most output was silently swallowed.
      Pytest offers the `ALLOW_UNICODE` and `ALLOW_BYTES` options for doctests, making
      it much easier to make our docstrings Python 2- and Python 3-compatiable.
      During this patch, it was attempted to leave the structure of the test code
      similar to before instead of converting everything to idiomatic pytest code.
      Luckily, pytest implements enough interoperability for most of our test code.
    • Manuel Jacob's avatar
      tests: drop unused `name` variable · 5d0842c83096
      Manuel Jacob authored
    • Manuel Jacob's avatar
      tests: rename module-level setup function from `setup()` to `setup_module()` · a8cbf1129123
      Manuel Jacob authored
      Nosetests treats both the same way. Pytest only understands `setup_module()`.
      In addition, one `teardown()` was renamed to `teardown_module()`.
  2. 14 Jul, 2020 5 commits
  3. 11 Jun, 2020 2 commits
  4. 19 Apr, 2020 1 commit
  5. 05 Mar, 2020 1 commit
  6. 25 Aug, 2019 1 commit
  7. 29 Aug, 2019 3 commits
  8. 25 Aug, 2019 2 commits
    • kiilerix's avatar
      assert: try to show some relevant value when an assert fails · 54976f208547
      kiilerix authored
      Debugging and print statements can tell more about failing asserts, but it is
      nice to get *some* information up front, also to make it easier to reproduce.
      General guidelines:
      Try to avoid anything that must compute something and thus can fail - try to
      just inspect local variables (or whatever assert looked at).
      For type related asserts, try to add repr().
      Sometimes, multiple variables are relevant - in that case use tuples.
    • Yuya Nishihara's avatar
      tests: make sure to load config defaults specific to TortoiseHg · 727dd7b266d2
      Yuya Nishihara authored
      Otherwise, the next patch would break the tests.
  9. 17 Jul, 2019 1 commit
  10. 01 Jun, 2019 1 commit
  11. 20 May, 2019 1 commit
  12. 19 May, 2019 1 commit
    • Matt Harbison's avatar
      py3: migrate unicode() to pycompat.unicode() · 6a0080d4e5a5
      Matt Harbison authored
      Fixed up after running `2to3 -w -n -f unicode .`, and re-adding the dropped u''
      prefixes.  The pycompat.unicode() hack is copied into setup.py because that
      module declares the dependency on mercurial.
  13. 12 Apr, 2019 1 commit
    • Matt Harbison's avatar
      py3: replace dict.iteritems() with .items() · 7b6638ab4daf
      Matt Harbison authored
      Converted with `2to3 -w -n -f dict .`, and then remove a bunch of list()
      wrapping.  The only place it seemed necessary was in repoview.py, as the
      collection is traversed more than once.
  14. 24 Mar, 2019 1 commit
    • Matt Harbison's avatar
      py3: replace cStringIO with pycompat.bytesio · 679593c2dbe6
      Matt Harbison authored
      Fixed up after running `2to3 -w -n -f imports -f imports2 .`.  There are other
      imports that need fixing, but not all have a pycompat alias.  So I'm splitting
      these up.
      TortoiseHgOverlayServer.py and thg replace stdio with byte buffers, which won't
      work on py3.  They need to be revisited to see if this is still necessary with
      py2exe[1].  In the meantime, I conditionalized a couple things there to prevent
      extra stacktraces on py3, since the local variable holding the buffer is used
      further down in each case.
      [1] https://groups.google.com/d/msg/thg-dev/dZbFjZugORs/sGOnxBpnBgAJ
  15. 05 May, 2019 3 commits
  16. 23 Mar, 2019 1 commit
  17. 24 Mar, 2019 2 commits
  18. 23 Mar, 2019 2 commits
  19. 19 Jan, 2019 1 commit
  20. 13 Jan, 2019 1 commit
  21. 05 Jan, 2019 1 commit
  22. 24 May, 2018 1 commit
  23. 14 Apr, 2018 1 commit
  24. 13 Jan, 2018 1 commit
  25. 05 Jan, 2018 1 commit
  26. 02 Jan, 2018 1 commit