Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit test failing: tests/unit/test_config.py::test_env_config_not_defined_does_not_raise #1764

Closed
JohnVillalovos opened this issue Dec 19, 2021 · 2 comments · Fixed by #1765

Comments

@JohnVillalovos
Copy link
Collaborator

Unit test appears to be picking up local file.


mock_clean_env = None

    def test_env_config_not_defined_does_not_raise(mock_clean_env):
>       assert config._get_config_files() == []
E       AssertionError: assert ['/home/jlvil...n-gitlab.cfg'] == []
E         Left contains one more item: '/home/jlvillal/.python-gitlab.cfg'
E         Full diff:
E         - []
E         + ['/home/jlvillal/.python-gitlab.cfg']

tests/unit/test_config.py:130: AssertionError
=============================================================================================================================== short test summary info ===============================================================================================================================
FAILED tests/unit/test_config.py::test_env_config_not_defined_does_not_raise - AssertionError: assert ['/home/jlvil...n-gitlab.cfg'] == []
====================================================================================================================== 1 failed, 687 passed, 33 skipped in 2.12s ======================================================================================================================
ERROR: InvocationError for command /home/jlvillal/sources/github-mine/python-gitlab/.tox/py310/bin/pytest tests/unit tests/meta -v (exited with code 1)
@JohnVillalovos
Copy link
Collaborator Author

@nejch Not sure if you have seen this or not.

@JohnVillalovos
Copy link
Collaborator Author

I did a git bisect and this was the bad commit:

commit 92a893b8e230718436582dcad96175685425b1df
Author: Nejc Habjan <hab.nejc@gmail.com>
Date:   Sun Dec 12 19:19:45 2021 +0100

    feat(cli): do not require config file to run CLI

    BREAKING CHANGE: A config file is no longer needed to run
    the CLI. python-gitlab will default to https://gitlab.com
    with no authentication if there is no config file provided.
    python-gitlab will now also only look for configuration
    in the provided PYTHON_GITLAB_CFG path, instead of merging
    it with user- and system-wide config files. If the
    environment variable is defined and the file cannot be
    opened, python-gitlab will now explicitly fail.

@JohnVillalovos JohnVillalovos changed the title Unit test failing Unit test failing: tests/unit/test_config.py::test_env_config_not_defined_does_not_raise Dec 19, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant