mockup: python: fix protocol parameterization + delete carthage support

Context

Once upon a time, there was a single versioned file test_mockup.py. It was parameterized pytest-style to execute on multiple protocols, i.e. the ones listed in constant MOCKUP_PROTOCOLS. Later on, the dreaded knights of the duplication came, and copied the original test_mockup.py to their respective castles:

> git ls-files '*test_mockup.py*'
tests_python/tests_007/test_mockup.py
tests_python/tests_008/test_mockup.py
tests_python/tests_alpha/test_mockup.py

However, test_mockup.py was a bit different from its friends; as it was already using multiple protocols. Hence every knight ended up with a test_mockup.py toy that was still executing on all protocols; consuming too many resources. Poor CI, it was running these tests again and again, for every member of MOCKUP_PROTOCOLS, for every test_mockup.py file 😿 This MR changes that:

  • It changes the protocol-dependent conftest.py files, so that the mockup_client fixture is NOT parameterized anymore by a list of protocols.
  • It removes the MOCKUP_PROTOCOLS constant which became useless since the duplication of test_mockup.py and hence removes its use to parametrize fixtures of test_mockup.py files.
  • It removes the mockup support of Carthage, as this is needed by !2315 (merged), to help @igarnier have a self-contained MR. As a consequence it deletes a test in 007: the test that used two protocols: the current protocol and the previous protocol.

As a result, the tests_mockup.py tests execute in circa 3 minutes; down from circa 9 minutes before (see logs in first comment).

Manually testing the MR

Execute: make && (cd tests_python && poetry run pytest $(find . -name test_mockup.py))

  • Witness that it passes
  • Witness that no test is parameterized by a protocol hash. Parameterization happens because of the multiple test_mockup.py files.

Checklist

  • NA: Document the interface of any function added or modified (see the coding guidelines)
  • Provide automatic testing (see the testing guide).
  • NA: Add item in the Development Version section of CHANGES.md (only for new features and bug fixes).

Reviewers

@arvidnl @bidinger @igarnier

Merge request reports

Loading