Modernize hosting service test class.

Review Request #14592 — Created Sept. 4, 2025 and updated

Information

Review Board
master

Reviewers

The hosting service specific testcase class provides some neat
utilities, but very little of it had any type hints. This change fleshes
those out, and fixes up a couple issues with some types in the base
hosting service that this exposed. Subclasses of this have been updated
for the new generic.

Ran unit tests.

Summary ID
Modernize hosting service test class.
The hosting service specific testcase class provides some neat utilities, but very little of it had any type hints. This change fleshes those out, and fixes up a couple issues with some types in the base hosting service that this exposed. Subclasses of this have been updated for the new generic. Testing Done: Ran unit tests.
pxqtwpvtwtupuropzrunmrwrlnzlyxtv
Description From Last Updated

Literal can go in TYPE_CHECKING.

chipx86chipx86

We should just import the type we need, but within a TYPE_CHECKING.

chipx86chipx86

This should also go in TYPE_CHECKING.

chipx86chipx86

This can also go in TYPE_CHECKING.

chipx86chipx86

This is in the wrong import group.

chipx86chipx86

This is missing docs with a Version Added.

chipx86chipx86

Missing the "Instance variables" block.

chipx86chipx86

We have a couple of these. Maybe we should TypeAlias it? Or Protocol it, make it match the argument signature …

chipx86chipx86

For all these, can we move the ) to the following line so the strings are isolated? More like we …

chipx86chipx86

While here, can we convert to keyword arguments?

chipx86chipx86

Existing code, but these should not be , optional.

chipx86chipx86

Missing a return type.

chipx86chipx86

Existing code, but these should not be , optional.

chipx86chipx86

Existing code, but these should not be , optional.

chipx86chipx86

This should be , optional.

chipx86chipx86

These should be , optional.

chipx86chipx86
chipx86
  1. 
      
  2. Show all issues

    Literal can go in TYPE_CHECKING.

  3. Show all issues

    We should just import the type we need, but within a TYPE_CHECKING.

  4. Show all issues

    This should also go in TYPE_CHECKING.

  5. Show all issues

    This can also go in TYPE_CHECKING.

  6. Show all issues

    This is in the wrong import group.

  7. Show all issues

    This is missing docs with a Version Added.

  8. reviewboard/hostingsvcs/testing/testcases.py (Diff revision 1)
     
     
     
     
     
    Show all issues

    Missing the "Instance variables" block.

  9. Show all issues

    We have a couple of these. Maybe we should TypeAlias it? Or Protocol it, make it match the argument signature so we gain typing there?

  10. reviewboard/hostingsvcs/testing/testcases.py (Diff revision 1)
     
     
     
     
    Show all issues

    For all these, can we move the ) to the following line so the strings are isolated? More like we do with dicts and lists.

  11. reviewboard/hostingsvcs/testing/testcases.py (Diff revision 1)
     
     
     
     
     
     
     
    Show all issues

    While here, can we convert to keyword arguments?

  12. reviewboard/hostingsvcs/tests/test_beanstalk.py (Diff revision 1)
     
     
     
     
     
     
     
     
    Show all issues

    Existing code, but these should not be , optional.

  13. Show all issues

    Missing a return type.

  14. reviewboard/hostingsvcs/tests/test_bitbucket.py (Diff revision 1)
     
     
     
     
     
     
     
     
     
    Show all issues

    Existing code, but these should not be , optional.

  15. reviewboard/hostingsvcs/tests/test_bitbucket.py (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
     
    Show all issues

    Existing code, but these should not be , optional.

  16. Show all issues

    This should be , optional.

  17. reviewboard/hostingsvcs/tests/test_rbgateway.py (Diff revision 1)
     
     
     
     
     
     
    Show all issues

    These should be , optional.

  18. 
      
david
Review request changed
Commits:
Summary ID
Modernize hosting service test class.
The hosting service specific testcase class provides some neat utilities, but very little of it had any type hints. This change fleshes those out, and fixes up a couple issues with some types in the base hosting service that this exposed. Subclasses of this have been updated for the new generic. Testing Done: Ran unit tests.
pxqtwpvtwtupuropzrunmrwrlnzlyxtv
Modernize hosting service test class.
The hosting service specific testcase class provides some neat utilities, but very little of it had any type hints. This change fleshes those out, and fixes up a couple issues with some types in the base hosting service that this exposed. Subclasses of this have been updated for the new generic. Testing Done: Ran unit tests.
pxqtwpvtwtupuropzrunmrwrlnzlyxtv

Checks run (2 succeeded)

flake8 passed.
JSHint passed.