Commit 0ab3ab9
Fix test execution on Bookworm (#3041)
* Fix test execution on Bookworm
Running tests with `python3 -m pytest` instead of `python setup.py test`
causes some breakages on Bookworm. Some of this has to do with what
module searc paths get added, while others appear to be related to
changes in the `mock` module between Python 3.9 and Python 3.11.
Fix this and make sure it works on both Bullseye and Bookworm.
* Fix mclag_test.py having different results for some test cases
The test_mclag_add_mclag_member_to_nonexisting_domain test case passes
when run on Bullseye, but fails on Bookworm. This is because some test
cases modify the value of `mclag.ADHOC_VALIDATION`, but this value may
persist for other test cases as well, and if test cases happen to run in
a different order, then it may unexpectedly fail.
For now, fix `test_mclag_add_mclag_member_to_nonexisting_domain` by
setting the value there.
* Add check_output parameter to the setup function due to the patch
Since there is a patched function specified as an attribute, newer
versions of mock expect that the object can be passed in as a parameter
to the function. However, the `setup` functions didn't accept it as a
parameter.
Modify the `setup` functions to accept a parameter for this object.
Signed-off-by: Saikrishna Arcot <[email protected]>
---------
Signed-off-by: Saikrishna Arcot <[email protected]>1 parent ef8f6f8 commit 0ab3ab9
File tree
7 files changed
+173
-730
lines changed- tests
7 files changed
+173
-730
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | 5 | | |
10 | 6 | | |
11 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
63 | 70 | | |
64 | 71 | | |
65 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
382 | | - | |
| 382 | + | |
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
199 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
| 363 | + | |
| 364 | + | |
363 | 365 | | |
364 | 366 | | |
365 | 367 | | |
| |||
Large diffs are not rendered by default.
0 commit comments