Nosetest not testing my test

I have a test file from ex47 in LPTHW in my project folder.The test file contains the init.py file, ex47_tests.py and ragnaroth_tests.py.It ran all three tests in ex47 tests and nosetests said"3 tests done".What I don’t know is that why is my ragnaroth test file with its one test function not being tested by nosetests even when it is in the same test folder and is importing all the same things( except for the game.py being replaced by another file I wrote).

    class ragnaroths(object):
        def __init__(self,move,place):
            self.name=name
            self.moves={}
            self.place={}
        def gets(self,move):
            moves.append(move)
        from nose.tools import *
        from ragnarothss import ragnaroths
        def inittest():
            pit=ragnaroths("move_up","west")
            assert_equal(pit.move,"move_up")
            assert_equal(pit.place,"west")

I indented every line with 4 spaces yet why isn’t this showing up as code!!??

Take a look now. I added [code] and [/code] around it.

You need to name the file with _tests.py and the functions that do testing test_init(). Also make sure the file is NOT executable as, for some dumb reason, nosetests doesn’t like that.

3 Likes

The GIS software called ArcGIS Map uses Python 2.7. This Esri product is not going anywhere, despite their release of ArcGIS Pro, which uses Python 3.4. So yes, Python 2 is definitely not going anywhere either.