Пример #1
0
    def test_looponfailing_removed_test(self):
        modcol = self.getmodulecol("""
            def test_one():
                assert 0
            def test_two():
                assert 0
        """)
        session = LooponfailingSession(modcol._config)
        loopstate = LoopState()
        session.remotecontrol.setup()
        loopstate.colitems = []
        session.loop_once(loopstate)
        assert len(loopstate.colitems) == 2

        modcol.fspath.write(py.code.Source("""
            def test_xxx(): # renamed test
                assert 0 
            def test_two():
                assert 1 # pass now
        """))
        assert session.statrecorder.check()
        session.loop_once(loopstate)
        assert len(loopstate.colitems) == 0

        session.loop_once(loopstate)
        assert len(loopstate.colitems) == 1
Пример #2
0
    def test_looponfail_removed_test(self, testdir):
        modcol = testdir.getmodulecol("""
            def test_one():
                assert 0
            def test_two():
                assert 0
        """)
        session = LooponfailingSession(modcol.config)
        loopstate = LoopState()
        session.remotecontrol.setup()
        loopstate.colitems = []
        session.loop_once(loopstate)
        assert len(loopstate.colitems) == 2

        modcol.fspath.write(py.code.Source("""
            def test_xxx(): # renamed test
                assert 0 
            def test_two():
                assert 1 # pass now
        """))
        assert session.statrecorder.check()
        session.loop_once(loopstate)
        assert len(loopstate.colitems) == 0

        session.loop_once(loopstate)
        assert len(loopstate.colitems) == 1
Пример #3
0
    def test_looponfailing_from_one_to_two_tests(self):
        modcol = self.getmodulecol("""
            def test_one():
                assert 0
        """)
        session = LooponfailingSession(modcol._config)
        loopstate = LoopState()
        session.remotecontrol.setup()
        loopstate.colitems = []
        session.loop_once(loopstate)
        assert len(loopstate.colitems) == 1

        modcol.fspath.write(py.code.Source("""
            def test_one():
                assert 1 # passes now
            def test_two():
                assert 0 # new and fails
        """))
        assert session.statrecorder.check()
        session.loop_once(loopstate)
        assert len(loopstate.colitems) == 0

        session.loop_once(loopstate)
        assert len(loopstate.colitems) == 1
Пример #4
0
    def test_looponfail_from_one_to_two_tests(self, testdir):
        modcol = testdir.getmodulecol("""
            def test_one():
                assert 0
        """)
        session = LooponfailingSession(modcol.config)
        loopstate = LoopState()
        session.remotecontrol.setup()
        loopstate.colitems = []
        session.loop_once(loopstate)
        assert len(loopstate.colitems) == 1

        modcol.fspath.write(py.code.Source("""
            def test_one():
                assert 1 # passes now
            def test_two():
                assert 0 # new and fails
        """))
        assert session.statrecorder.check()
        session.loop_once(loopstate)
        assert len(loopstate.colitems) == 0

        session.loop_once(loopstate)
        assert len(loopstate.colitems) == 1