Skip to content

Latest commit

 

History

History
232 lines (138 loc) · 7.42 KB

api-test.rst

File metadata and controls

232 lines (138 loc) · 7.42 KB

Test API

The test package contains classes and methods for running tests and evaluating test coverage.

This functionality is typically accessed via pytest. See test.

brownie.test.plugin

The plugin module contains classes and methods used in the Brownie Pytest plugin. It defines custom fixtures and handles integration into the Pytest workflow.

Pytest Fixtures

Brownie includes the following fixtures for use with pytest.

Note

These fixtures are only available when pytest is run from inside a Brownie project folder.

Session Fixtures

These fixtures provide access to objects related to the project being tested.

Isolation Fixtures

These fixtures are used to effectively isolate tests. If included on every test within a module, that module may now be skipped via the --update flag when none of the related files have changed since it was last run.

Coverage Fixtures

These fixtures alter the behaviour of tests when coverage evaluation is active.

RevertContextManager

The RevertContextManager closely mimics the behaviour of pytest.raises.

brownie.test.output

The output module contains methods for formatting and displaying test output.

Internal Methods

brownie.test.coverage

The coverage module is used storing and accessing coverage evaluation data.

Module Methods

Internal Methods

brownie.test._manager

The _manager module contains the TestManager class, used internally by Brownie to determine which tests should run and to load and save the test results.