Skip to content

Commit 04720f5

Browse files
authored
Merge pull request #418 from datacamp/lazy-imports
[CP-3513] Lazy imports
2 parents 73efcb4 + 5571da2 commit 04720f5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pythonwhat/Test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import re
2-
import numpy as np
32
from pythonwhat.tasks import *
43
from protowhat.Test import Test
54

@@ -95,6 +94,7 @@ def test(self):
9594
"""
9695
Perform the actual test. result is set to False if the objects differ, True otherwise.
9796
"""
97+
import numpy as np
9898
self.result = np.array(self.func(self.obj1, self.obj2)).all()
9999

100100

@@ -111,6 +111,7 @@ def areinstance(x, y, tuple_of_classes):
111111
def is_equal(x, y):
112112
import pandas as pd
113113
from pandas.testing import assert_frame_equal, assert_series_equal
114+
import numpy as np
114115
try:
115116
if areinstance(x, y, (Exception,)):
116117
# Types of errors don't matter (this is debatable)

pythonwhat/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
__version__ = "2.26.0"
1+
__version__ = "2.27.0"
22

33
from .test_exercise import test_exercise, allow_errors

0 commit comments

Comments
 (0)