Table of contents
- Make sure tests are running successfully with Testify before installing YourBase.
- Install YourBase.
- Your project must use Git and must have at least one commit. Git must be installed.
- Your Git workspace should be clean.
YourBase supplies a wrapper for the Testify command-line tool that serves as a drop-in replacement which applies acceleration.
Note: If your tests are going to take a while to run, you can run just a subset of your tests. Running a subset of tests will create a dependency graph just for those tests, so you can see YourBase Test Acceleration in action more quickly.
To use it, replace invocations of
# Old testify <files ...> # New yourbase testify <files ...>
If you use use Testify with Coverage.py, instead replace the command like so:
# Old coverage run -m testify.test_program <files ...> # New coverage run -m yourbase.plugins.testify <files ...>
Without making a code change, run your tests again using the same command as in step 1.
You’ll see that no tests are run. Since no code was changed since the last test run, YourBase Test acceleration ensures that no tests are run.
Note: When Testify runs no tests, it may exit nonzero and use the word “ERROR” to describe the results. This is normal Testify behavior, but the
yourbase wrapper will override it in a future update.
We’ve seen that YourBase can skip tests when they’re not affected by code changes. Let’s now see that it can run tests when they are!
Make a change to a function that gets called (directly or indirectly) by one or more tests. The change can be as simple as adding a print statement like:
print("Checking YourBase Test Acceleration after a code change...")
Use the same command as in step 1 to run your tests. Here, YourBase Test acceleration ensures the tests that depend on the changed function run, and others don’t.