Skip to content

Commit 86d7544

Browse files
authored
Add type annotations (#141)
1 parent b4f67b5 commit 86d7544

File tree

2 files changed

+33
-29
lines changed

2 files changed

+33
-29
lines changed

tests/test_examples_run.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
from dataclasses import dataclass
55
from typing import Optional
66

7+
from pytest import CaptureFixture, MonkeyPatch
8+
79
from pdl import pdl
810
from pdl.pdl_ast import ScopeType
911
from pdl.pdl_interpreter import PDLRuntimeError
@@ -144,7 +146,7 @@ class InputsType:
144146
]
145147

146148

147-
def test_valid_programs(capsys, monkeypatch) -> None:
149+
def test_valid_programs(capsys: CaptureFixture[str], monkeypatch: MonkeyPatch) -> None:
148150
actual_parse_error: set[str] = set()
149151
actual_runtime_error: set[str] = set()
150152
wrong_results = {}

tests/test_line_table.py

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from pytest import CaptureFixture
2+
13
from pdl.pdl_interpreter import generate
24

35

@@ -21,7 +23,7 @@ def do_test(t, capsys):
2123
}
2224

2325

24-
def test_line(capsys):
26+
def test_line(capsys: CaptureFixture[str]):
2527
do_test(line, capsys)
2628

2729

@@ -35,7 +37,7 @@ def test_line(capsys):
3537
}
3638

3739

38-
def test_line1(capsys):
40+
def test_line1(capsys: CaptureFixture[str]):
3941
do_test(line1, capsys)
4042

4143

@@ -49,7 +51,7 @@ def test_line1(capsys):
4951
}
5052

5153

52-
def test_line3(capsys):
54+
def test_line3(capsys: CaptureFixture[str]):
5355
do_test(line3, capsys)
5456

5557

@@ -63,7 +65,7 @@ def test_line3(capsys):
6365
}
6466

6567

66-
def test_line4(capsys):
68+
def test_line4(capsys: CaptureFixture[str]):
6769
do_test(line4, capsys)
6870

6971

@@ -77,7 +79,7 @@ def test_line4(capsys):
7779
}
7880

7981

80-
def test_line7(capsys):
82+
def test_line7(capsys: CaptureFixture[str]):
8183
do_test(line7, capsys)
8284

8385

@@ -91,7 +93,7 @@ def test_line7(capsys):
9193
}
9294

9395

94-
def test_line8(capsys):
96+
def test_line8(capsys: CaptureFixture[str]):
9597
do_test(line8, capsys)
9698

9799

@@ -105,7 +107,7 @@ def test_line8(capsys):
105107
}
106108

107109

108-
def test_line9(capsys):
110+
def test_line9(capsys: CaptureFixture[str]):
109111
do_test(line9, capsys)
110112

111113

@@ -118,7 +120,7 @@ def test_line9(capsys):
118120
}
119121

120122

121-
def test_line10(capsys):
123+
def test_line10(capsys: CaptureFixture[str]):
122124
do_test(line10, capsys)
123125

124126

@@ -131,7 +133,7 @@ def test_line10(capsys):
131133
}
132134

133135

134-
def test_line11(capsys):
136+
def test_line11(capsys: CaptureFixture[str]):
135137
do_test(line11, capsys)
136138

137139

@@ -145,7 +147,7 @@ def test_line11(capsys):
145147
}
146148

147149

148-
def test_line12(capsys):
150+
def test_line12(capsys: CaptureFixture[str]):
149151
do_test(line12, capsys)
150152

151153

@@ -159,7 +161,7 @@ def test_line12(capsys):
159161
}
160162

161163

162-
def test_line13(capsys):
164+
def test_line13(capsys: CaptureFixture[str]):
163165
do_test(line13, capsys)
164166

165167

@@ -173,7 +175,7 @@ def test_line13(capsys):
173175
}
174176

175177

176-
def test_line14(capsys):
178+
def test_line14(capsys: CaptureFixture[str]):
177179
do_test(line14, capsys)
178180

179181

@@ -186,7 +188,7 @@ def test_line14(capsys):
186188
}
187189

188190

189-
def test_line15(capsys):
191+
def test_line15(capsys: CaptureFixture[str]):
190192
do_test(line15, capsys)
191193

192194

@@ -200,7 +202,7 @@ def test_line15(capsys):
200202
}
201203

202204

203-
def test_line16(capsys):
205+
def test_line16(capsys: CaptureFixture[str]):
204206
do_test(line16, capsys)
205207

206208

@@ -214,7 +216,7 @@ def test_line16(capsys):
214216
}
215217

216218

217-
def test_line17(capsys):
219+
def test_line17(capsys: CaptureFixture[str]):
218220
do_test(line17, capsys)
219221

220222

@@ -227,7 +229,7 @@ def test_line17(capsys):
227229
}
228230

229231

230-
def test_line18(capsys):
232+
def test_line18(capsys: CaptureFixture[str]):
231233
do_test(line18, capsys)
232234

233235

@@ -242,7 +244,7 @@ def test_line18(capsys):
242244
}
243245

244246

245-
def test_line19(capsys):
247+
def test_line19(capsys: CaptureFixture[str]):
246248
do_test(line19, capsys)
247249

248250

@@ -255,7 +257,7 @@ def test_line19(capsys):
255257
}
256258

257259

258-
def test_line20(capsys):
260+
def test_line20(capsys: CaptureFixture[str]):
259261
do_test(line20, capsys)
260262

261263

@@ -268,7 +270,7 @@ def test_line20(capsys):
268270
}
269271

270272

271-
def test_line21(capsys):
273+
def test_line21(capsys: CaptureFixture[str]):
272274
do_test(line21, capsys)
273275

274276

@@ -281,7 +283,7 @@ def test_line21(capsys):
281283
}
282284

283285

284-
def test_line22(capsys):
286+
def test_line22(capsys: CaptureFixture[str]):
285287
do_test(line22, capsys)
286288

287289

@@ -294,7 +296,7 @@ def test_line22(capsys):
294296
}
295297

296298

297-
def test_line23(capsys):
299+
def test_line23(capsys: CaptureFixture[str]):
298300
do_test(line23, capsys)
299301

300302

@@ -307,7 +309,7 @@ def test_line23(capsys):
307309
}
308310

309311

310-
def test_line24(capsys):
312+
def test_line24(capsys: CaptureFixture[str]):
311313
do_test(line24, capsys)
312314

313315

@@ -335,7 +337,7 @@ def test_line24(capsys):
335337
}
336338

337339

338-
def test_line26(capsys):
340+
def test_line26(capsys: CaptureFixture[str]):
339341
do_test(line26, capsys)
340342

341343

@@ -348,7 +350,7 @@ def test_line26(capsys):
348350
}
349351

350352

351-
def test_line27(capsys):
353+
def test_line27(capsys: CaptureFixture[str]):
352354
do_test(line27, capsys)
353355

354356

@@ -361,7 +363,7 @@ def test_line27(capsys):
361363
}
362364

363365

364-
def test_line28(capsys):
366+
def test_line28(capsys: CaptureFixture[str]):
365367
do_test(line28, capsys)
366368

367369

@@ -374,7 +376,7 @@ def test_line28(capsys):
374376
}
375377

376378

377-
def test_line29(capsys):
379+
def test_line29(capsys: CaptureFixture[str]):
378380
do_test(line29, capsys)
379381

380382

@@ -387,7 +389,7 @@ def test_line29(capsys):
387389
}
388390

389391

390-
def test_line30(capsys):
392+
def test_line30(capsys: CaptureFixture[str]):
391393
do_test(line30, capsys)
392394

393395

@@ -402,5 +404,5 @@ def test_line30(capsys):
402404
}
403405

404406

405-
def test_line31(capsys):
407+
def test_line31(capsys: CaptureFixture[str]):
406408
do_test(line31, capsys)

0 commit comments

Comments
 (0)