Skip to content

Commit 65e583c

Browse files
committed
mypy: some improvements in type annotations
1 parent f051f49 commit 65e583c

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

schema_salad/makedoc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
_logger = logging.getLogger("salad")
2222

2323

24-
def has_types(items): # type: (Any) -> List[basestring]
24+
def has_types(items): # type: (Any) -> List[Text]
2525
r = [] # type: List
2626
if isinstance(items, dict):
2727
if items["type"] == "https://w3id.org/cwl/salad#record":

schema_salad/tests/test_errors.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from __future__ import print_function
33
from .util import get_data
44
import unittest
5-
from typing import cast
65
from schema_salad.schema import load_schema, load_and_validate
76
from schema_salad.validate import ValidationException
87
from avro.schema import Names
@@ -12,7 +11,6 @@ class TestErrors(unittest.TestCase):
1211
def test_errors(self):
1312
document_loader, avsc_names, schema_metadata, metaschema_loader = load_schema(
1413
get_data(u"tests/test_schema/CommonWorkflowLanguage.yml"))
15-
avsc_names = cast(Names, avsc_names)
1614

1715
for t in ("test_schema/test1.cwl",
1816
"test_schema/test2.cwl",

schema_salad/tests/test_fetch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import ruamel.yaml as yaml
1010
import json
1111
import os
12-
12+
from typing import Text
1313
from six.moves import urllib
1414

1515
class TestFetcher(unittest.TestCase):
@@ -18,15 +18,15 @@ class TestFetcher(schema_salad.ref_resolver.Fetcher):
1818
def __init__(self, a, b):
1919
pass
2020

21-
def fetch_text(self, url): # type: (unicode) -> unicode
21+
def fetch_text(self, url): # type: (Text) -> Text
2222
if url == "keep:abc+123/foo.txt":
2323
return "hello: keepfoo"
2424
if url.endswith("foo.txt"):
2525
return "hello: foo"
2626
else:
2727
raise RuntimeError("Not foo.txt")
2828

29-
def check_exists(self, url): # type: (unicode) -> bool
29+
def check_exists(self, url): # type: (Text) -> bool
3030
if url.endswith("foo.txt"):
3131
return True
3232
else:

0 commit comments

Comments
 (0)