Test assertion fail
Test assertion fail I've wrote a function which export dictionary as a string into csv file. In my assignment I'm instructed to export this dict as one string (I took keys from dict and separated them with commas - no spaces). I have a file which test this function - I'm here so of course it fails. However when I print output of that function it looks like in my assignment e.g sth1,sth2,sth3,sth4. What I'm missing here? Here is my code: def export_stock(stock, filename="export.csv"): with open(filename, "w+") as exportation: a = list(stock.keys()) a = ",".join(a) exportation.write(a) and here is test func: def test_export(self): export_stock({'sth1': 3, 'sth2': 1, "sth3": 1}, "export.csv") with open("export.csv", newline='') as csvfile: expected = ["sth1", "sth2", "sth3", "sth1", "sth1"] ...