datacamp / pythonwhat

Verify Python code submissions and auto-generate meaningful feedback messages.
http://pythonwhat.readthedocs.io/
GNU Affero General Public License v3.0
67 stars 31 forks source link

solution code not accepted with test_function: BLOCKING BETA TEST 06/28 #35

Closed hugobowne closed 8 years ago

hugobowne commented 8 years ago

https://campus.datacamp.com/courses/importing-data-into-python/introduction-and-flat-files?ex=13

(issue w/ line 7)

screenshot 2016-06-23 12 14 24

the weird thing is that the exact same SCT works perfectly in this exercise:

https://campus.datacamp.com/courses/importing-data-into-python/introduction-and-flat-files?ex=16

vvnkr commented 8 years ago

Use do_eval = False in test_function("type", ...). np.genfromtxt(file , delimiter = ",", names = True , dtype = None) is not the same two times, even with numpy.testing.assert_equal.

import numpy as np
np.testing.assert_equal(np.genfromtxt(file , delimiter = ",", names = True , dtype = None), np.genfromtxt(file , delimiter = ",", names = True , dtype = None))

Throws an AssertionError.

hugobowne commented 8 years ago

thanks. it works now: but aren't we testing type(data) == type(data), not that the arrays are equal?

vvnkr commented 8 years ago

type(data) is an argument of print(), so you're testing what you're suggesting with test_function("print", ...). With test_function("type", ...), you're testing the argument of type(...), which is data.

vvnkr commented 8 years ago

It will be live on Monday. I've tested your SCT with the fix and it worked so you don't have to change that. I'm currently at home and can't seem to reach the VPN here, which I need to push to production. Once in the office again on Monday I'll push it first thing in the morning :-).

hugobowne commented 8 years ago

gr8 thx sounds good to me have a nice weekend!!

vvnkr commented 8 years ago

Your SCT should work now

vvnkr commented 8 years ago

Woooops those last two comments of mine should've been on #36. This issue was closed, right?