Add typing for the functions in TestCase.

Review Request #14035 — Created July 13, 2024 and updated

Information

RBTools
release-5.x

Reviewers

This updates TestCase to add type hints all throughout. This helps
ensure we pass in the right typse to functions, and that we get the
right transport and client types when setting up state for API tests.

Unit tests pass.

Summary ID
Add typing for the functions in TestCase.
This updates `TestCase` to add type hints all throughout. This helps ensure we pass in the right typse to functions, and that we get the right transport and client types when setting up state for API tests.
9ae2883847e5d422970e673033ec2840462c31be
Description From Last Updated

'typing.Any' imported but unused Column: 1 Error code: F401

reviewbotreviewbot

redefinition of unused 'RBClient' from line 17 Column: 5 Error code: F811

reviewbotreviewbot

While you're here, mind adding docstrings and changing to super()?

daviddavid

Here too.

daviddavid

Now that we're properly using __future__.annotations, we should change from Dict to dict and List to list.

daviddavid

Blank line between these two.

daviddavid

Can we add a doc comment for this?

daviddavid

maxDiff doesn't appear to be used anywhere within the rbtools codebase. Can we just get rid of this?

daviddavid

Should probably be Any instead of object.

daviddavid
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
david
  1. 
      
  2. rbtools/testing/testcase.py (Diff revision 2)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    Show all issues

    While you're here, mind adding docstrings and changing to super()?

  3. rbtools/testing/testcase.py (Diff revision 2)
     
     
     
    Show all issues

    Here too.

  4. 
      
chipx86
Review request changed
Change Summary:
  • Added some docstrings to the setup/teardown methods.
  • Added additional type hints for class/instance variables.
  • Simplified super() calls.
Commits:
Summary ID
Add typing for the functions in TestCase.
This updates `TestCase` to add type hints all throughout. This helps ensure we pass in the right typse to functions, and that we get the right transport and client types when setting up state for API tests.
9c81b7bfff3bec145667b91c415b0f60a6734587
Add typing for the functions in TestCase.
This updates `TestCase` to add type hints all throughout. This helps ensure we pass in the right typse to functions, and that we get the right transport and client types when setting up state for API tests.
9ae2883847e5d422970e673033ec2840462c31be

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
david
  1. 
      
  2. rbtools/testing/testcase.py (Diff revision 3)
     
     
    Show all issues

    Now that we're properly using __future__.annotations, we should change from Dict to dict and List to list.

  3. rbtools/testing/testcase.py (Diff revision 3)
     
     
     
    Show all issues

    Blank line between these two.

  4. rbtools/testing/testcase.py (Diff revision 3)
     
     
    Show all issues

    Can we add a doc comment for this?

  5. rbtools/testing/testcase.py (Diff revision 3)
     
     
    Show all issues

    maxDiff doesn't appear to be used anywhere within the rbtools codebase. Can we just get rid of this?

  6. rbtools/testing/testcase.py (Diff revision 3)
     
     
    Show all issues

    Should probably be Any instead of object.

  7.