Skip to content

Commit

Permalink
no doctest for eca
Browse files Browse the repository at this point in the history
  • Loading branch information
stgm committed Oct 5, 2022
1 parent 6e2dadc commit f8c52ea
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions tests/_typecheck.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import checkpy.tests as t
import checkpy.lib as lib
import checkpy.assertlib as assertlib

import subprocess

@t.test(1000)
def mypy_ok(test):
def testMethod():
p = subprocess.run(['mypy', '--strict', test.fileName], capture_output=True, universal_newlines=True)
return p.returncode == 0, p.stdout

def report(output):
return 'line ' + '\n - line '.join([':'.join(i.split(':')[1:]) for i in output.splitlines()[:-1]])

test.description = lambda: "types are specified and correctly used"
test.test = testMethod
test.fail = report
2 changes: 1 addition & 1 deletion tests/eca2csvTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import hashlib

from _extensions import *
from _typecheck import *

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

0 comments on commit f8c52ea

Please sign in to comment.