Changeset 33:d466f464c871 in pyenvjasmine for pyenvjasmine/tests/test_runner.py


Ignore:
Timestamp:
Jan 19, 2018, 11:43:48 AM (6 years ago)
Author:
Borja Lopez <borja@…>
Branch:
default
Phase:
public
Message:

Fix for Runner.did_test_pass(), ensuring we catch failed tests
even if they do not appear in the "Failed:" report at the end of the
tests run

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pyenvjasmine/tests/test_runner.py

    r31 r33  
    9292        finally:
    9393            os.name = old_os_name
     94
     95    def test_did_test_pass(self):
     96        # there is some coverage done with the previous tests,
     97        # but we want to test also the case when a test failed
     98        # and it does not appear in the "Failed:" report
     99        jstests = Runner()
     100        success = jstests.did_test_pass('')
     101        assert not success
     102        success = jstests.did_test_pass('some random data '*50)
     103        assert not success
     104        success = jstests.did_test_pass('some data FAILED some more data')
     105        assert not success
     106        success = jstests.did_test_pass('some data FAILEDsome more data')
     107        assert not success
     108        success = jstests.did_test_pass('Failed: 0')
     109        assert success
     110        success = jstests.did_test_pass('Failed: 0 FAILED')
     111        assert not success
     112        success = jstests.did_test_pass('FAILEDFailed: 0')
     113        assert not success
     114        success = jstests.did_test_pass('Failed: 0FAILED')
     115        assert not success
     116        success = jstests.did_test_pass('Failed: 1')
     117        assert not success
     118        success = jstests.did_test_pass('Failed: -11')
     119        assert not success
     120        success = jstests.did_test_pass('Failed: something-not-a-number')
     121        assert not success
Note: See TracChangeset for help on using the changeset viewer.