python - Mysterious SyntaxError in nosetest of functions/files -


So I'm trying to write a test for the part of a word parser function which will basically confirm that the parser returns The part for which I am writing a test is a function called "peak", where it takes a list of Tuples ('TYPE', 'WORD' format in Tuples), and returns the value in 'TYPE' to Tupal The code for the peak part of the part parser (the file is in parser.py) is as follows:

  def peek (word_list): if word_list: word = word list [0] is back word [0] and: there is no back   

where " The word_list "is a list of Tupe's in the question, so my test is basically designed to see if the Peak Function actually recognizes the Tupe's list in" Word_list "and returns the value 'TYPE' from Tipple which runs it is. My code for this test is as follows: Import nose.tools from

  * Import parser DEF from ex49 test_peek (): word_list = [('direction', 'answer')] assert_equal Parser) .peek ([['direction', 'north']], 'direction') result = parser.peek (word_list) assert_equal (result, ['direction'])   

It looks as though it should be correct, but when I run the nozzats, I get this error message:

  result = parser.peak (word_list) ^ syntax error: invalid syntax < / code>  

I have all Keeps parentheses, commas, operator, and double the variable values ​​and triple-check, and I do not see me a syntax error, or anything that inspires you to believe me that will cause a syntax error. Am I missing something

This is just one missing leg surrounded by the previous line: Html>

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -