Python Forum
Assert Error: AssertionError
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Assert Error: AssertionError
#1
Hi!

The function stergereTranzactie(list,zi) delete a number from a list.
The function testarestergereTranzactie() tests stergereTranzactie(list,zi).

How can I solve this error/How can I use "assert" in this situation?


def stergereTranzactie(list,zi):
    del(list[zi])

def testarestergereTranzactie():
    assert (stergereTranzactie([12, 13, 14, 15], 0)==[13, 14, 15])

def mainFunction():
    testarestergereTranzactie()
    
mainFunction()
Error:
Traceback (most recent call last): File "C:/Users/Petru/Desktop/test.py", line 12, in <module> mainFunction() File "C:/Users/Petru/Desktop/test.py", line 9, in mainFunction testarestergereTranzactie() File "C:/Users/Petru/Desktop/test.py", line 5, in testarestergereTranzactie assert (stergereTranzactie([12, 13, 14, 15], 0)==[13, 14, 15]) AssertionError
Thanks!
Reply


Messages In This Thread
Assert Error: AssertionError - by AlexPetru - Oct-15-2019, 07:34 PM
RE: Assert Error: AssertionError - by buran - Oct-15-2019, 07:42 PM
RE: Assert Error: AssertionError - by AlexPetru - Oct-15-2019, 07:48 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020