<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.itcollege.ee/index.php?action=history&amp;feed=atom&amp;title=I719_Fundamentals_of_Python%2Ftest_results</id>
	<title>I719 Fundamentals of Python/test results - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.itcollege.ee/index.php?action=history&amp;feed=atom&amp;title=I719_Fundamentals_of_Python%2Ftest_results"/>
	<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=I719_Fundamentals_of_Python/test_results&amp;action=history"/>
	<updated>2026-06-16T02:41:55Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=I719_Fundamentals_of_Python/test_results&amp;diff=123194&amp;oldid=prev</id>
		<title>Eroman: Created page with &quot;= Test Result Output =  == Example Code ==  &lt;code&gt;app.py&lt;/code&gt;  &lt;source lang=&quot;python&quot;&gt;def get_hello_world_1():     return &quot;Hello World!&quot;   def get_hello_world_2():     &quot;&quot;&quot;Ret...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=I719_Fundamentals_of_Python/test_results&amp;diff=123194&amp;oldid=prev"/>
		<updated>2017-06-06T09:26:25Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= Test Result Output =  == Example Code ==  &amp;lt;code&amp;gt;app.py&amp;lt;/code&amp;gt;  &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;def get_hello_world_1():     return &amp;quot;Hello World!&amp;quot;   def get_hello_world_2():     &amp;quot;&amp;quot;&amp;quot;Ret...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Test Result Output =&lt;br /&gt;
&lt;br /&gt;
== Example Code ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;app.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;def get_hello_world_1():&lt;br /&gt;
    return &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def get_hello_world_2():&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Returns wrong text&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    return &amp;quot;Wrong Text.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def get_hello_world_3():&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Will raise an error when run&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    return hello_world&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;test_app.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;import app&lt;br /&gt;
import unittest&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class HelloWorld1TestCase(unittest.TestCase):&lt;br /&gt;
    def test_value(self):&lt;br /&gt;
        result = app.get_hello_world_1()&lt;br /&gt;
        self.assertEqual(&amp;quot;Hello World!&amp;quot;, result)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class HelloWorld2TestCase(unittest.TestCase):&lt;br /&gt;
    def test_value(self):&lt;br /&gt;
        result = app.get_hello_world_2()&lt;br /&gt;
        self.assertEqual(&amp;quot;Hello World!&amp;quot;, result)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class HelloWorld3TestCase(unittest.TestCase):&lt;br /&gt;
    def test_value(self):&lt;br /&gt;
        result = app.get_hello_world_3()&lt;br /&gt;
        self.assertEqual(&amp;quot;Hello World!&amp;quot;, result)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
== Output ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;.FE&lt;br /&gt;
======================================================================&lt;br /&gt;
ERROR: test_value (test_app.HelloWorld3TestCase)&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
Traceback (most recent call last):&lt;br /&gt;
  File &amp;amp;quot;/tmp/test_app.py&amp;amp;quot;, line 19, in test_value&lt;br /&gt;
    result = app.get_hello_world_3()&lt;br /&gt;
  File &amp;amp;quot;/tmp/app.py&amp;amp;quot;, line 12, in get_hello_world_3&lt;br /&gt;
    return hello_world&lt;br /&gt;
NameError: name &amp;#039;hello_world&amp;#039; is not defined&lt;br /&gt;
&lt;br /&gt;
======================================================================&lt;br /&gt;
FAIL: test_value (test_app.HelloWorld2TestCase)&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
Traceback (most recent call last):&lt;br /&gt;
  File &amp;amp;quot;/tmp/test_app.py&amp;amp;quot;, line 14, in test_value&lt;br /&gt;
    self.assertEqual(&amp;amp;quot;Hello World!&amp;amp;quot;, result)&lt;br /&gt;
AssertionError: &amp;#039;Hello World!&amp;#039; != &amp;#039;Wrong Text.&amp;#039;&lt;br /&gt;
- Hello World!&lt;br /&gt;
+ Wrong Text.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
Ran 3 tests in 0.001s&lt;br /&gt;
&lt;br /&gt;
FAILED (failures=1, errors=1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Overview ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt; is a passing test&lt;br /&gt;
* &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt; is a failure&lt;br /&gt;
* &amp;lt;code&amp;gt;E&amp;lt;/code&amp;gt; is an error&lt;br /&gt;
&lt;br /&gt;
NOTE: The test results do not appear in a consistent order.&lt;br /&gt;
&lt;br /&gt;
=== Passing Test ===&lt;br /&gt;
&lt;br /&gt;
Since the assertion -- &amp;lt;code&amp;gt;assertEqual&amp;lt;/code&amp;gt; -- is called with &amp;#039;Hello World!&amp;#039; and &amp;#039;Hello World!&amp;#039;, no error is raised.&lt;br /&gt;
&lt;br /&gt;
=== Failing Test ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FAIL: test_value (test_app.HelloWorld2TestCase)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;FAIL&amp;lt;/code&amp;gt;, means the test failed&lt;br /&gt;
* &amp;lt;code&amp;gt;test_value&amp;lt;/code&amp;gt; is the name of the method in the TestCase&lt;br /&gt;
* &amp;lt;code&amp;gt;test_app.HelloWorld2TestCase&amp;lt;/code&amp;gt; is the python path to the TestCase&lt;br /&gt;
&lt;br /&gt;
The assertion -- &amp;lt;code&amp;gt;assertEqual&amp;lt;/code&amp;gt; -- is called with &amp;#039;Hello World!&amp;#039; and &amp;#039;Wrong Text.&amp;#039;. These two strings are not equal, so &amp;lt;code&amp;gt;assertEqual&amp;lt;/code&amp;gt; raises an &amp;lt;code&amp;gt;AssertionError&amp;lt;/code&amp;gt;. When an &amp;lt;code&amp;gt;AssertionError&amp;lt;/code&amp;gt; is raised, the test fails.&lt;br /&gt;
&lt;br /&gt;
You will see in the &amp;lt;code&amp;gt;FAIL&amp;lt;/code&amp;gt; test result the values used. This is helpful to figure out what went wrong.&lt;br /&gt;
&lt;br /&gt;
=== Error ===&lt;br /&gt;
&lt;br /&gt;
The function -- &amp;lt;code&amp;gt;get_hello_world_3&amp;lt;/code&amp;gt; raises a &amp;lt;code&amp;gt;NameError&amp;lt;/code&amp;gt;, since the name &amp;#039;hello_world&amp;#039; is not defined. When an error is raised, and the error is NOT an &amp;lt;code&amp;gt;AssertionError&amp;lt;/code&amp;gt;, then the test result is a special failure called an &amp;amp;quot;error&amp;amp;quot;.&lt;/div&gt;</summary>
		<author><name>Eroman</name></author>
	</entry>
</feed>