Add pytest mode to djblets.testing.testrunners.TestRunner.

Review Request #13075 — Created May 30, 2023 and submitted

Information

Djblets
release-4.x

Reviewers

We've mostly phased out nose from our own usage, but it's still being
used for the extension test runner. The behavior is different enough
that we need a transition period to move people over.

In most cases, once extensions are configured in a way to make use of
pytest, they'll be able to just run pytest instead of rbext test,
but we also want latter to continue to exist.

This change adds a mode to the TestRunner to use pytest instead of nose.
That can be opted into for now, and in a future version we'll switch it
over and remove the nose mode.

Ran rbintegrations tests via pytest and our test runner.

Summary ID
Add pytest mode to djblets.testing.testrunners.TestRunner.
We've mostly phased out nose from our own usage, but it's still being used for the extension test runner. The behavior is different enough that we need a transition period to move people over. In most cases, once extensions are configured in a way to make use of pytest, they'll be able to just run `pytest` instead of `rbext test`, but we also want latter to continue to exist. This change adds a mode to the TestRunner to use pytest instead of nose. That can be opted into for now, and in a future version we'll switch it over and remove the nose mode. Testing Done: Ran rbintegrations tests via pytest and our test runner.
40f67ca4d0ec8fc94dc1f95cc38c03737b921db5
Description From Last Updated

Let's make both of these conditional. An extension may not have either of these installed, or may have only one …

chipx86chipx86

This needs a Version Added.

chipx86chipx86

This needs a Version Added.

chipx86chipx86

Parameters should start on the next line, indented one level. Function should have -> None at the end.

chipx86chipx86

Missing : bool. Otherwise this is Literal[False].

chipx86chipx86

And pytest_options.

chipx86chipx86

Both of these should have Version Added.

chipx86chipx86

No pass here.

chipx86chipx86

str, not unicode.

chipx86chipx86
chipx86
  1. 
      
  2. djblets/testing/testrunners.py (Diff revision 1)
     
     
     

    Let's make both of these conditional. An extension may not have either of these installed, or may have only one as we transition.

  3. djblets/testing/testrunners.py (Diff revision 1)
     
     
     
     
     

    This needs a Version Added.

  4. djblets/testing/testrunners.py (Diff revision 1)
     
     

    This needs a Version Added.

  5. djblets/testing/testrunners.py (Diff revision 1)
     
     
     
     
     
     
     
     
     

    Parameters should start on the next line, indented one level. Function should have -> None at the end.

  6. djblets/testing/testrunners.py (Diff revision 1)
     
     

    Missing : bool. Otherwise this is Literal[False].

  7. djblets/testing/testrunners.py (Diff revision 1)
     
     

    And pytest_options.

  8. djblets/testing/testrunners.py (Diff revision 1)
     
     
     
     
     
     
     
     

    Both of these should have Version Added.

  9. djblets/testing/testrunners.py (Diff revision 1)
     
     

    No pass here.

  10. djblets/testing/testrunners.py (Diff revision 1)
     
     
     
     
     
     
     

    str, not unicode.

  11. 
      
david
chipx86
  1. Ship It!
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-4.x (38ab901)
Loading...