click-contrib / click-default-group

Extends click.Group to invoke a command without explicit subcommand name.
BSD 3-Clause "New" or "Revised" License
73 stars 17 forks source link

1.2.2: test suite is failing #16

Closed kloczek closed 1 year ago

kloczek commented 3 years ago
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.10.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
Using --randomly-seed=1090834362
rootdir: /home/tkloczko/rpmbuild/BUILD/click-default-group-1.2.2, configfile: setup.cfg
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, aspectlib-1.5.2, toolbox-0.5, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, flaky-3.7.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, datadir-1.3.1, regressions-2.2.0, cases-3.6.3, xprocess-0.18.1, black-0.3.12, anyio-3.3.0, asyncio-0.15.1, trio-0.7.0, subtests-0.5.0, isort-2.0.0, hypothesis-6.14.6, mock-3.6.1, profiling-1.7.0, randomly-3.8.0, Faker-8.12.1, nose2pytest-1.0.8, pyfakefs-4.5.1, tornado-0.8.1, twisted-1.13.3
collected 7 items

test.py ...F...                                                                                                                                                      [100%]

================================================================================= FAILURES =================================================================================
___________________________________________________________________ test_default_command_with_arguments ____________________________________________________________________

    def test_default_command_with_arguments():
        assert r.invoke(cli, ['--foo', 'foooo']).output == 'foooo\n'
>       assert 'no such option' in r.invoke(cli, ['-x']).output
E       assert 'no such option' in "Usage: cli foo [OPTIONS]\nTry 'cli foo --help' for help.\n\nError: No such option: -x\n"
E        +  where "Usage: cli foo [OPTIONS]\nTry 'cli foo --help' for help.\n\nError: No such option: -x\n" = <Result SystemExit(2)>.output
E        +    where <Result SystemExit(2)> = <bound method CliRunner.invoke of <click.testing.CliRunner object at 0x7f4b7e04f850>>(cli, ['-x'])
E        +      where <bound method CliRunner.invoke of <click.testing.CliRunner object at 0x7f4b7e04f850>> = <click.testing.CliRunner object at 0x7f4b7e04f850>.invoke

test.py:33: AssertionError
========================================================================= short test summary info ==========================================================================
FAILED test.py::test_default_command_with_arguments - assert 'no such option' in "Usage: cli foo [OPTIONS]\nTry 'cli foo --help' for help.\n\nError: No such option: -x\n"
======================================================================= 1 failed, 6 passed in 0.56s ========================================================================
pytest-xprocess reminder::Be sure to terminate the started process by running 'pytest --xkill' if you have not explicitly done so in your fixture with 'xprocess.getinfo(<process_name>).terminate()'.
kloczek commented 3 years ago

ping ..

webknjaz commented 1 year ago

v1.2.4 doesn't seem to have failing CI.

sublee commented 1 year ago

This issue has been fixed on v1.2.4.

kloczek commented 1 year ago

Are you testing libcgroub inside lxc zone as it is in my case? 🤔

sublee commented 1 year ago

@kloczek I don't understand what you mean.

kloczek commented 1 year ago

I'm using lxc to create per package build envs so test suite is executed inside such env.

sublee commented 1 year ago

@kloczek I think the test should pass regardless of which runtime environment because click-default-group is a pure-Python implementation. However, I don't know a way to reproduce your environment. Please give me a minimal reproducible code.

kloczek commented 1 year ago

Sorry my fault. I have another ticket about libcgroup failing test suite in which fact that everything is running inside lxc zone is relevant.