samedi 9 juin 2018

Python unittest returns "Ran 0 tests in 0.000s" and I have no idea why

I'm stuck with this problem and I have no idea why this test doesn't work. Please anyone help me.

Code below is in the cityname.py file

def get_name(city, country):
    return (city.title() + ", " + country.title())

Code below is in the test_cities.py file

import unittest

from cityname import get_name

class CitiesTestCase(unittest.TestCase):
    """Tests for 'city_functions.py'."""

def test_city_country(self):
    """Does a simple city and country pair work?"""
    santiago_chile = get_name('santiago', 'chile')
    self.assertEqual(santiago_chile, 'Santiago, Chile')

unittest.main()

Here is the output

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK

Aucun commentaire:

Enregistrer un commentaire