You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 'main' of https://github.com/Azure/azure-sdk-for-python: (63 commits)
check only once whether artifact extension exists (Azure#29594)
code and test (Azure#29530)
fix: support data binding expression for resources.xxx (Azure#29559)
code and test (Azure#29558)
[ServiceBus] enable sovereign cloud testing (Azure#29202)
[AutoRelease] t2-communication-2023-03-20-22792(can only be merged by SDK owner) (Azure#29453)
[Identity] Allow configurable process timeouts (Azure#28290)
Increment package version after release of azure-containerregistry (Azure#29582)
Update optional (Azure#28435)
[Monitor][Query] Add sample notebook for large queries (Azure#28148)
Update CHANGELOG.md (Azure#29580)
[ServiceBus] remove msrest (Azure#29324)
Explicitly set PSNativeCommandArgumentPassing to Legacy for git push script (Azure#29554)
[ML][Pipelines] Support queue settings in pipeline job (Azure#29209)
add experimental decorator for datatransfer (Azure#29562)
Featurestore/online store crud new pr (Azure#29546)
switch tooling over to typespec (Azure#29501)
set up base path for feature set in load function (Azure#29544)
Address credential description in docstring (Azure#29549)
[Monitor] Regen query and ingestion (Azure#29504)
...
Copy file name to clipboardExpand all lines: doc/dev/static_type_checking_cheat_sheet.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -164,6 +164,24 @@ def foo(
164
164
...
165
165
```
166
166
167
+
- Do use `Optional` if a parameter can be typed as `Any` or `None`. `Optional[Any]`, or `Union[Any, None]`, is __not__ equal to `Any`.
168
+
169
+
```python
170
+
from typing import Optional, Any
171
+
172
+
# Yes
173
+
deffoo(
174
+
bar: Optional[Any] =None,
175
+
) -> None:
176
+
bar.append(1) # error caught at type checking time: Item "None" of "Optional[Any]" has no attribute "append"
177
+
178
+
# No
179
+
deffoo(
180
+
bar: Any =None,
181
+
) -> None:
182
+
bar.append(1) # error caught at runtime: AttributeError: 'NoneType' object has no attribute 'append'
183
+
```
184
+
167
185
### Collections
168
186
169
187
- Do familiarize yourself with the supported operations of various abstract collections in the [collections.abc](https://docs.python.org/3/library/collections.abc.html#collections-abstract-base-classes) docs.
Copy file name to clipboardExpand all lines: doc/dev/test_proxy_migration_guide.md
+9-42Lines changed: 9 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ Please refer to the [troubleshooting guide][troubleshooting] if you have any iss
24
24
-[Advanced details](#advanced-details)
25
25
-[What does the test proxy do?](#what-does-the-test-proxy-do)
26
26
-[How does the test proxy know when and what to record or play back?](#how-does-the-test-proxy-know-when-and-what-to-record-or-play-back)
27
-
-[Start the proxy manually](#start-the-proxy-manually)
27
+
-[Use pytest.mark.parametrize with migrated tests](#use-pytestmarkparametrize-with-migrated-tests)
28
28
29
29
## Update existing tests
30
30
@@ -96,10 +96,7 @@ Resource preparers need a management client to function, so test classes that us
96
96
97
97
### Perform one-time setup
98
98
99
-
1. Docker (or Podman) is a requirement for using the test proxy. You can install Docker from [docs.docker.com][docker_install], or install Podman at [podman.io][podman]. To use Podman, set an alias for `podman` to replace the `docker` command.
100
-
2. After installing, make sure Docker/Podman is running and is using Linux containers before running tests.
101
-
3. Follow the instructions [here][proxy_cert_docs] to complete setup. You need to trust a certificate on your machine in
102
-
order to communicate with the test proxy over a secure connection.
99
+
The test proxy uses a self-signed certificate to communicate with HTTPS. Follow the general setup instructions [here][proxy_cert_docs] to trust this certificate locally.
103
100
104
101
### Start the proxy server
105
102
@@ -120,8 +117,8 @@ def start_proxy(test_proxy):
120
117
return
121
118
```
122
119
123
-
The `test_proxy` fixture will fetch the test proxy Docker image and create a new container called
124
-
`ambitious_azsdk_test_proxy`, which will be deleted after test execution unless interrupted.
120
+
The `test_proxy` fixture will download a test proxy executable if one isn't available locally, start the tool, and stop
121
+
it after tests complete.
125
122
126
123
If your tests already use an `autouse`d, session-level fixture for tests, you can accept the `test_proxy` parameter in
127
124
that existing fixture instead of adding a new one. For an example, see the [Register sanitizers](#register-sanitizers)
@@ -141,6 +138,9 @@ Recordings for a given package will end up in that package's `/tests/recordings`
141
138
do. Recordings that use the test proxy are `.json` files instead of `.yml` files, so migrated test suites no longer
142
139
need old `.yml` recordings.
143
140
141
+
After migrating to use the test proxy, libraries can and are encouraged to use out-of-repo recordings. For more
142
+
information, refer to the [recording migration guide][recording_migration].
143
+
144
144
> **Note:** support for configuring live or playback tests with a `testsettings_local.cfg` file has been
145
145
> deprecated in favor of using just `AZURE_TEST_RUN_LIVE`.
146
146
@@ -153,7 +153,7 @@ Instead, sanitizers (as well as matchers and transforms) can be registered on th
153
153
`add_general_string_sanitizer`. Other sanitizers are available for more specific scenarios and can be found at
Copy file name to clipboardExpand all lines: doc/dev/tests.md
+5-13Lines changed: 5 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -169,10 +169,7 @@ To migrate an existing test suite to use the test proxy, or to learn more about
169
169
170
170
### Perform one-time test proxy setup
171
171
172
-
1. Docker (or Podman) is a requirement for using the test proxy. You can install Docker from [docs.docker.com][docker_install], or install Podman at [podman.io][podman]. To use Podman, set an alias for `podman` to replace the `docker` command.
173
-
2. After installing, make sure Docker/Podman is running and is using Linux containers before running tests.
174
-
3. Follow the instructions [here][proxy_cert_docs] to complete setup. You need to trust a certificate on your machine in
175
-
order to communicate with the test proxy over a secure connection.
172
+
The test proxy uses a self-signed certificate to communicate with HTTPS. Follow the general setup instructions [here][proxy_cert_docs] to trust this certificate locally.
176
173
177
174
### Set up test resources
178
175
@@ -383,11 +380,8 @@ to the process of updating recordings.
383
380
384
381
- The targeted library is already migrated to use the test proxy.
385
382
- Git version > 2.25.0 is to on the machine and in the path. Git is used by the script and test proxy.
386
-
-[Docker][docker_install] or [Podman][podman] is installed.
387
383
- Global [git config settings][git_setup] are configured for `user.name` and `user.email`.
388
384
- These settings are also set with environment variables `GIT_COMMIT_OWNER` and `GIT_COMMIT_EMAIL`, respectively (in your environment or your local `.env` file).
389
-
- The environment variable `GIT_TOKEN` is set to a valid [personal access token][git_token] for your user (in your environment or your local `.env` file).
390
-
- This token is necessary for authenticating git requests made in a Docker/Podman container.
391
385
- Membership in the `azure-sdk-write` GitHub group.
392
386
393
387
Test recordings will be updated if tests are run while `AZURE_TEST_RUN_LIVE` is set to "true" and
@@ -409,15 +403,16 @@ The recording directory in this case is `2Km2Z8755`, the string between the two
409
403
410
404
After verifying that your recording updates look correct, you can use the [`manage_recordings.py`][manage_recordings]
411
405
script from `azure-sdk-for-python/scripts` to push these recordings to the `azure-sdk-assets` repo. This script accepts
412
-
a verb and a **relative** path to your package's `assets.json` file. For example, from the root of the
413
-
`azure-sdk-for-python` repo:
406
+
a verb and a **relative** path to your package's `assets.json` file (this path is optional, and simply `assets.json`
407
+
by default). For example, from the root of the `azure-sdk-for-python` repo:
0 commit comments