uwhpsc-2016 / homework1

Homework #1
1 stars 1 forks source link

code seems to work but it's not passing test #22

Open gadamico opened 8 years ago

gadamico commented 8 years ago

My collatz_step function seems to work just fine when I'm trying it out in a Jupyter notebook, but when I run the test_homework1.py file I get errors (and one fail on the collatz_step_error test). Could it be that the test file is somehow not reading my code?

cswiercz commented 8 years ago

The script test_homework1.py only reads the contents of the module homework1. That is, you need to supply the definitions of the functions in homework1/exercise1.py. In fact, you can see the import statements at the top of the script.

A Jupyter notebook is fine for experimenting with code but there is no way for the test suite to be aware of this code. A good workflow might be to write some code in the notebook while trying to figure out a solution and once you're ready to put everything into a function do so by filling in the definitions of homework1.exercise1.collatz_step, etc.

gadamico commented 8 years ago

Right. I'll have to go back and look at it, but I thought I had written the code into homework1/exercise1 and then was importing it into the notebook.