cvut / NI-PYT

Materiály k předmětu NI-PYT na FIT ČVUT
https://courses.fit.cvut.cz/NI-PYT/
Creative Commons Attribution Share Alike 4.0 International
112 stars 28 forks source link

test_help_list_labels #104

Closed HalfDeadPie closed 6 years ago

HalfDeadPie commented 6 years ago

Dobry den, chcel by som sa spytat ci je nutne nejak explicitne menit exit code po zadani --help v list_labels a ak hej, tak ako. Aktualne neprejdem testom, pretoze moj program skonci kodom 3 a nie kodom 0.

@pytest.mark.parametrize('isolated', [True, False]) def test_help_list_labels(invoker_norec, isolated):

There must be standard click help describing options

    # and commands (you should write description for each)
    #
    # Local default config is not required (no token for help is OK)!
    #
    # It could look like this (help text may differ):
    # Usage: labelord.py list_labels [OPTIONS] REPOSITORY
    #
    # Listing labels of desired repository.
    #
    # Options:
    #   --help  Show this message and exit.
    invocation = invoker_norec('list_labels', '--help', isolated=isolated)
  assert invocation.result.exit_code == 0

E assert 3 == 0 E + where 3 = <Result SystemExit(3,)>.exit_code E + where <Result SystemExit(3,)> = <conftest.LabelordInvocation object at 0x042B7A50>.result

tests\test_run_tricky.py:117: AssertionError !!!!!!!!!!!!!!!!!!! Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!! ===================== 1 failed, 64 passed in 2.88 seconds =====================

hroncok commented 6 years ago

Zkus si to pustit mimo testy. Problém není jen s exit kódem, ale s tím, že ti program při použití --help skončí chybou. Viz https://github.com/MarekSuchanek/labelord_tests/issues/6