unit testing in python editor of class

I am addicted to write unit tests whenever I am writing a code. Python has a very good unit testing framework. Since python editor in class doesn't allow import, I cannot write unit tests.

I understand the reason behind not allowing imports, but can we pre import some modules and make one of them unittest?

asked 25 Feb '12, 23:00

mustafa%20ispir's gravatar image

mustafa ispir
4222414
accept rate: 25%


3 Answers:

Starting with the next unit you will be able to import whatever you want.

link

answered 25 Feb '12, 23:36

PeterUdacity's gravatar image

PeterUdacity ♦♦
35.9k73219331

I doubt it doesn't allow imports, it's just that you're not supposed to use them right now.

link

answered 25 Feb '12, 23:23

Fuzzmz's gravatar image

Fuzzmz
2.1k1732

I think you can just copy the code you've written for the assignment and paste it to your local machine where you can do anything to the code.

link

answered 25 Feb '12, 23:34

John%20Chow's gravatar image

John Chow
449

edited 25 Feb '12, 23:37

Your answer
Question text:

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×15,339
×236
×89
×70
×1

Asked: 25 Feb '12, 23:00

Seen: 294 times

Last updated: 25 Feb '12, 23:37