@@ -36,17 +36,17 @@ Once your changes are ready to submit for review:
36361 . Code style
3737
3838 This project uses several tools to maintain a consistent code style:
39-
39+
4040 * the automatic code formatter [ black] ( https://black.readthedocs.io/en/stable/ )
4141 * sorting of imports via [ isort] ( https://isort.readthedocs.io/en/latest/ )
4242 * [ flake8] ( http://flake8.pycqa.org/en/latest/ )
4343 * License header check via custom script
44-
44+
4545 The easiest way to make sure your pull request adheres to the the code style
4646 is to install [ pre-commit] ( https://pre-commit.com/ ) .
47-
47+
4848 pip install pre-commit # or "brew install pre-commit" if you use Homebrew
49-
49+
5050 pre-commit install
5151
52521 . Test your changes
@@ -87,6 +87,23 @@ you need to install several databases (Elasticsearch, PostgreSQL, MySQL, Cassand
8787This can be quite a hassle, so we recommend to use our dockerized test setup.
8888See [ Running tests] ( https://www.elastic.co/guide/en/apm/agent/python/master/run-tests-locally.html ) for detailed instructions.
8989
90+ However, for running local unit tests, you can install the relevant
91+ [ requirements files] ( https://github.com/elastic/apm-agent-python/tree/master/tests/requirements )
92+ and then run ` py.test ` from the project root.
93+
94+ Pytest will automatically discover all the tests and skip the ones for which
95+ dependencies are not met.
96+
97+ #### Pytest
98+
99+ This project uses [ pytest] ( https://docs.pytest.org/en/latest/ ) for all of its
100+ testing needs. Note that pytest can be a bit confusing at first, due to its
101+ dynamic discovery features. In particular,
102+ [ fixtures] ( https://docs.pytest.org/en/stable/fixture.html ) can be confusing
103+ and hard to discover, due to the fact that they do not need to be imported to
104+ be used. For example, whenever a test has ` elasticapm_client ` as an argument,
105+ that is a fixture which is defined
106+ [ here] ( https://github.com/elastic/apm-agent-python/blob/ed4ce5fd5db3cc091a54d3328384fbce62635bbb/tests/fixtures.py#L150 ) .
90107
91108### Workflow
92109
0 commit comments