Skip to content

Commit f8c52ea

Browse files
committed
no doctest for eca
1 parent 6e2dadc commit f8c52ea

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

tests/_typecheck.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import checkpy.tests as t
2+
import checkpy.lib as lib
3+
import checkpy.assertlib as assertlib
4+
5+
import subprocess
6+
7+
@t.test(1000)
8+
def mypy_ok(test):
9+
def testMethod():
10+
p = subprocess.run(['mypy', '--strict', test.fileName], capture_output=True, universal_newlines=True)
11+
return p.returncode == 0, p.stdout
12+
13+
def report(output):
14+
return 'line ' + '\n - line '.join([':'.join(i.split(':')[1:]) for i in output.splitlines()[:-1]])
15+
16+
test.description = lambda: "types are specified and correctly used"
17+
test.test = testMethod
18+
test.fail = report

tests/eca2csvTest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import hashlib
66

7-
from _extensions import *
7+
from _typecheck import *
88

99
def sandbox():
1010
lib.require("climate.txt", "https://raw.githubusercontent.com/minprog/pyprog/2022/opdrachten/week5/eca2csv/climate.txt")

0 commit comments

Comments
 (0)