File tree 2 files changed +11
-4
lines changed
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
35
35
36
36
You can provide directories or individual files as positional arguments to specify particular tests to run rather than running the entire test suite. For example:
37
37
``` 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
40
40
```
41
41
42
42
If you have print statements in your tests for debugging you can add the ` -s ` flag to send those print statements to standard output:
43
43
``` Shell
44
- sdk/storage/azure-mgmt-storage> pytest sdk/storage/azure-mgmt-storage/ -s
44
+ sdk/storage/azure-mgmt-storage> pytest -s
45
45
```
46
46
47
47
## Getting Azure credentials
@@ -106,6 +106,7 @@ def get_credentials(**kwargs):
106
106
``` python
107
107
def get_azure_core_credentials (** kwargs ):
108
108
from azure.identity import ClientSecretCredential
109
+ import os
109
110
return ClientSecretCredential(
110
111
client_id = os.environ[' AZURE_CLIENT_ID' ],
111
112
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
84
84
azure-sdk-for-python\sdk\my-directory\my-library> pytest <test_file.py>
85
85
```
86
86
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
+
87
93
In addition you can provide keywords to run specific tests within the suite or within a specific file
88
94
``` cmd
89
95
azure-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]
293
299
[ azure_devtools ] : https://pypi.org/project/azure-devtools/
294
300
[ engsys_wiki ] : https://dev.azure.com/azure-sdk/internal/_wiki/wikis/internal.wiki/48/Create-a-new-Live-Test-pipeline?anchor=test-resources.json
295
301
[ 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