charmed-kubernetes / pytest-operator

Apache License 2.0
7 stars 13 forks source link

fix `no-deploy` parameter check #67

Closed rgildein closed 2 years ago

rgildein commented 2 years ago

Moved no-deploy parameter check from pytest_addoption function to pytest_load_initial_conftests.

test_run: https://pastebin.ubuntu.com/p/4ypnsdg79p/

fixes: #65

rgildein commented 2 years ago

The idea came from pytest_cmdline_preparse hook.

addyess commented 2 years ago

@r-f-g is this one ready for being merged/published at 0.15.0

ca-scribner commented 2 years ago

I too would love to know why this did not work before and does work now. But it appears to be ok?

addyess commented 2 years ago

dunno, but i'd love to have it merged, as i have a huge PR on pytest-operator upcoming @r-f-g any thing else here?

rgildein commented 2 years ago

I'm stumped as to why this resolves the issue, unless calling parser._getparser() too early is somehow cheating something.

This is due to the try_argcomplete function, which needs to be run before parser._getparser().

rgildein commented 2 years ago

@addyess I think it's ready and we can merge it.