Commit d4560e6
Implement testcontainers for pytest-managed container lifecycle
Tests now automatically start MySQL and MinIO containers via testcontainers.
No manual `docker-compose up` required - just run `pytest tests/`.
Changes:
- conftest.py: Add mysql_container and minio_container fixtures that
auto-start containers when tests run and stop them afterward
- pyproject.toml: Add testcontainers[mysql,minio] dependency, update
pixi tasks, remove pytest-env (no longer needed)
- docker-compose.yaml: Update docs to clarify it's optional for tests
- README.md: Comprehensive developer guide with clear instructions for
running tests, pre-commit hooks, and PR submission checklist
Usage:
- Default: `pytest tests/` - testcontainers manages containers
- External: `DJ_USE_EXTERNAL_CONTAINERS=1 pytest` - use docker-compose
Benefits:
- Zero setup for developers - just `pip install -e ".[test]" && pytest`
- Dynamic ports (no conflicts with other services)
- Automatic cleanup after tests
- Simpler CI configuration
Version bump to 2.0.0a7
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>1 parent 11e492b commit d4560e6
File tree
5 files changed
+289
-149
lines changed- src/datajoint
- tests
5 files changed
+289
-149
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
153 | | - | |
154 | | - | |
| 152 | + | |
155 | 153 | | |
156 | 154 | | |
157 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
161 | | - | |
| 160 | + | |
| 161 | + | |
162 | 162 | | |
163 | | - | |
164 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
165 | 168 | | |
166 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
167 | 176 | | |
168 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
169 | 181 | | |
170 | 182 | | |
171 | 183 | | |
172 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
173 | 200 | | |
174 | 201 | | |
175 | 202 | | |
| |||
183 | 210 | | |
184 | 211 | | |
185 | 212 | | |
186 | | - | |
| 213 | + | |
187 | 214 | | |
188 | 215 | | |
189 | 216 | | |
190 | | - | |
191 | | - | |
| 217 | + | |
192 | 218 | | |
193 | 219 | | |
194 | 220 | | |
195 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
196 | 225 | | |
197 | | - | |
198 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
199 | 236 | | |
200 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
201 | 250 | | |
202 | 251 | | |
203 | | - | |
| 252 | + | |
204 | 253 | | |
205 | 254 | | |
206 | 255 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
8 | 13 | | |
9 | 14 | | |
10 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | 87 | | |
89 | 88 | | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | 99 | | |
101 | 100 | | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
| 161 | + | |
175 | 162 | | |
176 | 163 | | |
177 | 164 | | |
| |||
187 | 174 | | |
188 | 175 | | |
189 | 176 | | |
190 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
191 | 181 | | |
192 | 182 | | |
193 | | - | |
194 | | - | |
195 | | - | |
| 183 | + | |
196 | 184 | | |
197 | 185 | | |
198 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
0 commit comments