The test
package contains classes and methods for running tests and evaluating test coverage.
This functionality is typically accessed via pytest. See pytest
.
The fixtures
module contains custom fixtures provided by the Brownie Pytest plugin.
Note
These fixtures are only available when pytest
is run from inside a Brownie project folder.
These fixtures provide access to objects related to the project being tested.
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.
These fixtures alter the behaviour of tests when coverage evaluation is active.
The strategies
module contains the strategy <strategies.strategy>
method, and related internal methods for generating Hypothesis search strategies.
The stateful
module contains the state_machine <stateful.state_machine>
method, and related internal classes and methods for performing stateful testing.
The plugin
module is the entry point for the Brownie pytest plugin. It contains two pytest
hook point methods that are used for setting up the plugin. The majority of the plugin functionality is handled by a plugin manager<api-test-plugin-manager>
which is instantiated in the pytest_configure
method.
The manager
module contains Brownie classes used internally to manage the Brownie pytest plugin.
One of these classes is instantiated in the pytest_configure
method of brownie.test.plugin
. Which is used depends on whether or not pytest-xdist is active.
The RevertContextManager
closely mimics the behaviour of pytest.raises <pytest.raises>
.
The output
module contains methods for formatting and displaying test output.
The coverage
module is used storing and accessing coverage evaluation data.