Skip to content

Instantly share code, notes, and snippets.

@echohack
Created January 13, 2013 05:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save echohack/4522427 to your computer and use it in GitHub Desktop.
Save echohack/4522427 to your computer and use it in GitHub Desktop.
A short bit of code to test a SublimeText Python developer environment.
class MyPrint:
def __init__(self):
pass
def myPrint(self):
for item in range(10):
print("This is the item at " + str(item) + " .")
return True
class MyPrint_Test():
p = None
@classmethod
def setup_class(cls):
cls.p = MyPrint()
@classmethod
def teardown_class(cls):
cls.p = None
def myPrint_test(self):
assert p.myPrint()
@ne0stigmine
Copy link

When I run the unit test, I get NameError: global name 'p' is not defined, why??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment