Skip to content

Commit b1e915c

Browse files
Fixing a minor bug in a test (#8223)
### Description There is a minor bug in a test which causes a second fail to occur when one does. In `test_module_list.py`, there is a list of classes to check which must have aliases removed from it. This must be done before the test assert so that in the event the assert fails this removal isn't skipped. ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: Eric Kerfoot <eric.kerfoot@kcl.ac.uk> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 13b96ae commit b1e915c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/test_module_list.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,17 @@ def test_transform_api(self):
5858
continue
5959
with self.subTest(n=n):
6060
basename = n[:-1] # Transformd basename is Transform
61+
62+
# remove aliases to check, do this before the assert below so that a failed assert does skip this
63+
for postfix in ("D", "d", "Dict"):
64+
remained.remove(f"{basename}{postfix}")
65+
6166
for docname in (f"{basename}", f"{basename}d"):
6267
if docname in to_exclude_docs:
6368
continue
6469
if (contents is not None) and f"`{docname}`" not in f"{contents}":
6570
self.assertTrue(False, f"please add `{docname}` to docs/source/transforms.rst")
66-
for postfix in ("D", "d", "Dict"):
67-
remained.remove(f"{basename}{postfix}")
71+
6872
self.assertFalse(remained)
6973

7074

0 commit comments

Comments
 (0)