Skip to content

Commit 1a88d38

Browse files
committed
Improve imports
1 parent 1dbebb9 commit 1a88d38

34 files changed

Lines changed: 35 additions & 40 deletions

pythonwhat/checks/check_funcs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def with_context(state, *args, child=None):
194194
if isinstance(close_solution_context, Exception):
195195
raise InstructorError(
196196
"error in the solution, closing the `with` fails with: %s"
197-
% (close_solution_context)
197+
% close_solution_context
198198
)
199199

200200
close_student_context = breakDownNewEnvInProcess(process=state.student_process)

pythonwhat/sct_syntax.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
from pythonwhat.probe import Node, Probe, TEST_NAMES
55
from pythonwhat.utils import include_v1
66
from pythonwhat import test_funcs
7-
from functools import partial, reduce, wraps
8-
import inspect
9-
import copy
7+
from functools import wraps
108

119
# TODO: could define scts for check_wrappers at the module level
1210
ATTR_SCTS = scts.copy()

pythonwhat/tasks.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,9 @@ def getResultFromProcess(res, tempname, process):
298298
"""Get a value from process, return tuple of value, res if succesful"""
299299
if not isinstance(res, (UndefinedValue, Exception)):
300300
value = getRepresentation(tempname, process)
301-
return (value, res)
301+
return value, res
302302
else:
303-
return (res, str(res))
303+
return res, str(res)
304304

305305

306306
# decorator to automatically get value after running process task function
@@ -332,9 +332,9 @@ def get_output(f, process, shell, *args, **kwargs):
332332
out_str = out[0].strip()
333333
if not isinstance(res, Exception):
334334
toret = out_str or "no printouts"
335-
return (toret, toret)
335+
return toret, toret
336336
else:
337-
return (res, str(res))
337+
return res, str(res)
338338

339339

340340
@process_task

pythonwhat/test_funcs/utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from protowhat.Feedback import InstructorError
44
from pythonwhat.Feedback import Feedback
5-
from protowhat.Test import Test
65
from pythonwhat.Test import EqualTest
76
from pythonwhat.checks.check_funcs import StubState
87
from pythonwhat.checks.has_funcs import evalCalls

pythonwhat/utils_env.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import copy
21
import ast
32

43

tests/test_author_warnings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22
import ast
3-
from tests import helper
3+
import tests.helper as helper
44

55
from pythonwhat.local import setup_state
66
from protowhat.Feedback import InstructorError

tests/test_check_class_def.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pytest
2-
from tests import helper
2+
import tests.helper as helper
33
from pythonwhat.local import setup_state
44
from pythonwhat.sct_syntax import v2_check_functions
55

tests/test_check_function.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pytest
2-
from tests import helper
2+
import tests.helper as helper
33
from pythonwhat.local import setup_state
44
from protowhat.Test import TestFail as TF
55
from protowhat.Feedback import InstructorError

tests/test_check_function_def.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pytest
2-
from tests import helper
2+
import tests.helper as helper
33

44
from pythonwhat.local import setup_state
55
from pythonwhat.sct_syntax import v2_check_functions

tests/test_check_if_else.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pytest
2-
from tests import helper
2+
import tests.helper as helper
33

44

55
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)