Table of contents
- Make sure tests are running successfully with unittest 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.
tests/__init__.py file, copy-paste the following:
import unittest import yourbase yourbase.attach(unittest)
For example, to run all the tests for the project, use:
python -m unittest discover
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.
Without making a code change, run your tests again using the same command as in step 2.
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.
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][step-1] to run your tests. Here, YourBase Test acceleration ensures the tests that depend on the changed function run, and others don’t.