python/osmo-python-tests[master]: osmoutil: add pick_test() to pick unittest tests by name

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Wed Mar 1 12:14:07 UTC 2017


Patch Set 1:

couldn't find "Class.name" in the python unittest doc, do you have a specific pointer?
There seems to be a test name selection with the unittest.main(), but we're not using main().

What we do is

    suite = unittest.TestSuite()
    suite.addTest(unittest.TestLoader().loadTestsFromTestCase(TestVTYMGCP))
    suite.addTest(unittest.TestLoader().loadTestsFromTestCase(TestVTYNITB))
    add_bsc_test(suite, workdir)
    add_nat_test(suite, workdir)
    add_gbproxy_test(suite, workdir)
    add_sgsn_test(suite, workdir)
    res = unittest.TextTestRunner(verbosity=verbose_level, stream=sys.stdout).run(suite)

and after we have this suite there is no way to tell run() to just go for one of those.
My quickest way to get to run only testBSCreload was to ipython on it to find the private
members and drop those names I don't want from the suite object.

It's not very nice, but it works, and saves me effort to grind that bloaty API.

-- 
To view, visit https://gerrit.osmocom.org/1935
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I92f90c334169f31920c63dd5c5ac8dac215065e6
Gerrit-PatchSet: 1
Gerrit-Project: python/osmo-python-tests
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-HasComments: No



More information about the gerrit-log mailing list