File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -35,13 +35,13 @@ sdk/storage/azure-mgmt-storage> pytest
3535
3636You can provide directories or individual files as positional arguments to specify particular tests to run rather than running the entire test suite. For example:
3737``` Shell
38- sdk/storage/azure-mgmt-storage> pytest sdk/storage/azure-mgmt-storage/
39- sdk/storage/azure-mgmt-storage> pytest sdk/storage/azure-mgmt-storage/ tests/test_mgmt_storage.py
38+ sdk/storage/azure-mgmt-storage> pytest
39+ sdk/storage/azure-mgmt-storage> pytest tests/test_mgmt_storage.py
4040```
4141
4242If you have print statements in your tests for debugging you can add the ` -s ` flag to send those print statements to standard output:
4343``` Shell
44- sdk/storage/azure-mgmt-storage> pytest sdk/storage/azure-mgmt-storage/ -s
44+ sdk/storage/azure-mgmt-storage> pytest -s
4545```
4646
4747## Getting Azure credentials
@@ -106,6 +106,7 @@ def get_credentials(**kwargs):
106106``` python
107107def get_azure_core_credentials (** kwargs ):
108108 from azure.identity import ClientSecretCredential
109+ import os
109110 return ClientSecretCredential(
110111 client_id = os.environ[' AZURE_CLIENT_ID' ],
111112 client_secret = os.environ[' AZURE_CLIENT_SECRET' ],
Original file line number Diff line number Diff line change @@ -84,6 +84,12 @@ azure-sdk-for-python\sdk\my-directory\my-library> pytest
8484azure-sdk-for-python\sdk\my-directory\my-library> pytest <test_file.py>
8585```
8686
87+ If your tests are broken up into multiple folders for organization, you can run specific folders:
88+ ``` cmd
89+ azure-sdk-for-python\sdk\my-directory\my-library> pytest .\tests\async_tests\
90+ azure-sdk-for-python\sdk\my-directory\my-library> pytest .\tests\async_tests\<test_file.py>
91+ ```
92+
8793In addition you can provide keywords to run specific tests within the suite or within a specific file
8894``` cmd
8995azure-sdk-for-python\sdk\my-directory\my-library> pytest -k <keyword>
@@ -293,4 +299,4 @@ For more information, refer to the [advanced tests notes][advanced_tests_notes]
293299[ azure_devtools ] : https://pypi.org/project/azure-devtools/
294300[ engsys_wiki ] : https://dev.azure.com/azure-sdk/internal/_wiki/wikis/internal.wiki/48/Create-a-new-Live-Test-pipeline?anchor=test-resources.json
295301[ mgmt_settings_fake ] : https://github.com/Azure/azure-sdk-for-python/blob/master/tools/azure-sdk-tools/devtools_testutils/mgmt_settings_fake.py
296- [ packaging ] : ./packaging.md
302+ [ packaging ] : ./packaging.md
You can’t perform that action at this time.
0 commit comments