Commit 32fd479
authored
tests(spanner): avoid table name collisions in tests (#18001)
# Fix Spanner Test Flakes: Avoid Generic Table Names
## Problem
The `sqlalchemy-spanner` test suite occasionally fails with `Duplicate
name in schema: t.` errors. This happens because multiple tests use the
generic table name `t`. In a shared database environment, or due to
buffered DDL statements in Spanner (which are non-transactional), a
table from a previous test might still exist when a new test tries to
create it.
## Solution
Renamed the generic table name `t` to more specific names in several
tests and fixtures to avoid collisions.
- In `tests/conftest.py`, renamed `t` to `t_literal_round_trip_spanner`.
- In `tests/test_suite_14.py`:
- Renamed `t` to `t_nullable_reflection` in `test_nullable_reflection`.
- Renamed `t` to `t_type_round_trip` in `_type_round_trip`.
- Renamed `t` to `t_percent_signs` in `EscapingTest`.
- Renamed `t` to `t_do_numeric` in `NumericTest`.
## Notes to Reviewers
These changes are purely in test code and aim to improve test stability
by eliminating shared resource name collisions.1 parent 2207ca6 commit 32fd479
2 files changed
Lines changed: 11 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
204 | 206 | | |
205 | 207 | | |
206 | 208 | | |
207 | | - | |
208 | | - | |
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
| 253 | + | |
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
| 263 | + | |
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
271 | 273 | | |
272 | 274 | | |
273 | 275 | | |
274 | 276 | | |
275 | | - | |
| 277 | + | |
276 | 278 | | |
277 | 279 | | |
278 | 280 | | |
| |||
1207 | 1209 | | |
1208 | 1210 | | |
1209 | 1211 | | |
1210 | | - | |
| 1212 | + | |
1211 | 1213 | | |
1212 | 1214 | | |
1213 | 1215 | | |
| |||
1551 | 1553 | | |
1552 | 1554 | | |
1553 | 1555 | | |
1554 | | - | |
| 1556 | + | |
1555 | 1557 | | |
1556 | 1558 | | |
1557 | 1559 | | |
| |||
0 commit comments