nautobot icon indicating copy to clipboard operation
nautobot copied to clipboard

Make it possible to run all of our "linting" unit tests quickly (no db setup)

Open gsnider2195 opened this issue 1 year ago • 2 comments

Proposed Changes

Potentially make a new unittest tag for linting so that we can run just those tests and make sure all of those tests are using unittest.TestCase as the base test class instead of any of the django testcases. This allows the test runner to skip database setup and factory data generation if it's not required for the tests being run. (See nautobot.core.tests.test_celery)

Maybe make an alias to run tests with this tag in our invoke tasks.py, similar to integration tests.

Update our pre-commit hook to run these tests.

Justification

Faster run time for these unit tests that may be useful for pre-commit checks but when the full unittest suite isn't appropriate.

gsnider2195 avatar Mar 01 '24 16:03 gsnider2195