0

In Zed Shaw's "Learn Python the Hard Way" tutorial 46, students are asked to create a tests/NAME_tests.py file. But I got / is not a valid character error in Aptana Studios and Notepad++. What am I doing wrong?

Here's the code that Zed asks to put into that file.

from nose.tools import *
import NAME

def setup():
    print "SETUP!"

def teardown():
    print "TEAR DOWN!"

def test_basic():
    print "I RAN!
3
  • can you show us some of your code? Commented Oct 18, 2012 at 22:14
  • If you are using Windows you might need to name it "tests\NAME_tests.py". Commented Oct 18, 2012 at 22:17
  • 1
    Just create a folder called tests and create a file called NAME_tests.py inside it. Commented Oct 18, 2012 at 22:21

2 Answers 2

3

By

tests/NAME_tests.py

It's to create a file named NAME_tests.py under a folder named tests.

UPDATE

An excerpt from Learn Python The Hard Way confirming the final structure:

setup.py
NAME/
    __init__.py
bin/
docs/
tests/
    NAME_tests.py
    __init__.py
Sign up to request clarification or add additional context in comments.

Comments

1

Since you cite errors from the editors, not in the code, it sounds like you might be trying to save a file literally called "tests/NAME_tests.py".

That only works if you already have a tests subdirectory in the current directory the file save dialog shows.

If you don't, create that first, navigate into it, then save the file as NAME_tests.py.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.