Scientific Computing with Python Projects - Budget App

Please if someone could help me. I don’t know why the chart’s display is wrong. I checked the part by the part and it seems to work properly, but when I test it, an error occurs.

FAIL: test_create_spend_chart (test_module.UnitTests)

Traceback (most recent call last):
File “/home/runner/boilerplate-budget-app/test_module.py”, line 102, in test_create_spend_chart
self.assertEqual(actual, expected, ‘Expected different chart representation. Check that all spacing is exact.’)
AssertionError: 'Perc[34 chars] \n 90| \n 80| \n 70| o[316 chars] t ’ != 'Perc[34 chars] \n 90| \n 80| \n 70| [340 chars] t ’
Percentage spent by category

  • 100|
  • 100|
    ? +
  • 90|
  • 90|
    ? +
  • 80|
  • 80|
    ? +
  • 70| o
  • 70| o
    ? +
  • 60| o
  • 60| o
    ? +
  • 50| o
  • 50| o
    ? +
  • 40| o
  • 40| o
    ? +
  • 30| o
  • 30| o
    ? +
  • 20| o o
  • 20| o o
    ? +
  • 10| o o
  • 10| o o
    ? +
  • 0| o o o
  • 0| o o o
    ? +

  •  B  F  E 
    
  •  B  F  E  
    

? +

  •  u  o  n 
    
  •  u  o  n  
    

? +

  •  s  o  t 
    
  •  s  o  t  
    

? +

  •  i  d  e 
    
  •  i  d  e  
    

? +

  •  n     r 
    
  •  n     r  
    

? +

  •  e     t 
    
  •  e     t  
    

? +

  •  s     a 
    
  •  s     a  
    

? +

  •  s     i 
    
  •  s     i  
    

? +

  •        n 
    
  •        n  
    

? +

  •        m 
    
  •        m  
    

? +

  •        e 
    
  •        e  
    

? +

  •        n 
    
  •        n  
    

? +

  •        t +            t  ?              +
    

: Expected different chart representation. Check that all spacing is exact.


Ran 11 tests in 0.023s

FAILED (failures=1)

Link for my code: https://replit.com/@DraganKrsic/boilerplate-budget-app#budget.py

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36

Challenge: Scientific Computing with Python Projects - Budget App

Link to the challenge:

-  10|    o  o 
+  10|    o  o  
?              +
-   0| o  o  o 
+   0| o  o  o  
?              +
      ----------
-      B  F  E 
+      B  F  E  
?              +

You’ve got to post errors and code in code blocks (it’s the </> button in the gear menu on the post editor) like I did with a bit of your error.

The red - lines are your output. The green + lines are the expected output. The ? line is showing you where the problem is.

I didn’t understand how to get these colors, but I understand where is the problem. This was of great help to me.
Thanks a lot!

The coloring is a feature of using the code blocks; it colors them automatically which is helpful since space is transparent.

There are testing environments that use output coloring that you can add to your local python setup if you want to set them up and use them.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.