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

10 tests fail #168

Open
yurivict opened this issue Jan 25, 2024 · 1 comment · May be fixed by #170
Open

10 tests fail #168

yurivict opened this issue Jan 25, 2024 · 1 comment · May be fixed by #170
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@yurivict
Copy link

It seems that tests expect specific versions of python packages (see "requests==1.0.0" below)?

========================================================================================= FAILURES ==========================================================================================
_________________________________________________________________________ test_check_with_missing_constraints_file __________________________________________________________________________

    def test_check_with_missing_constraints_file():
        result = RUNNER.invoke(
            lower_bound_checker.check,
            [
                "--package-name",
                GOOD_PACKAGE,
                "--constraints-file",
                "missing_constraints.txt",
            ],
        )
    
        assert result.exit_code == 1
>       assert isinstance(result.exception, FileNotFoundError)
E       AssertionError: assert False
E        +  where False = isinstance(PackageNotFoundError('valid-package'), FileNotFoundError)
E        +    where PackageNotFoundError('valid-package') = <Result PackageNotFoundError('valid-package')>.exception

tests/unit/test_lower_bound_checker.py:178: AssertionError
_____________________________________________________________________ test_check_with_constraints_file_missing_packages _____________________________________________________________________

    def test_check_with_constraints_file_missing_packages():
        constraints = [
            "requests==1.0.0",
            "packaging==14.0",
            # missing 'wheel' and 'click' and extra 'grpcio'
        ]
        with constraints_file(constraints) as c:
            result = RUNNER.invoke(
                lower_bound_checker.check, ["--package-name", GOOD_PACKAGE, "--constraints-file", c]
            )
    
>       assert result.exit_code == 2
E       AssertionError: assert 1 == 2
E        +  where 1 = <Result PackageNotFoundError('valid-package')>.exit_code

tests/unit/test_lower_bound_checker.py:211: AssertionError
________________________________________________________________________________________ test_check _________________________________________________________________________________________

    def test_check():
        constraints = [
            "requests==1.0.0",
            "packaging==14.0",
            "wheel==0.41.0",
            "click==7.0.0",
            "grpcio==1.0.0"
        ]
        with constraints_file(constraints) as c:
            result = RUNNER.invoke(
                lower_bound_checker.check, ["--package-name", GOOD_PACKAGE, "--constraints-file", c]
            )
    
>       assert result.exit_code == 0
E       AssertionError: assert 1 == 0
E        +  where 1 = <Result PackageNotFoundError('valid-package')>.exit_code

tests/unit/test_lower_bound_checker.py:146: AssertionError
________________________________________________________________ test_update_constraints_with_setup_py_missing_lower_bounds _________________________________________________________________

    def test_update_constraints_with_setup_py_missing_lower_bounds():
        constraints = [
            "requests==1.0.0",
            "packaging==14.0",
            "wheel==0.41.0",
            "click==7.0.0",
        ]
        with constraints_file(constraints) as c:
            result = RUNNER.invoke(
                lower_bound_checker.update, ["--package-name", BAD_PACKAGE, "--constraints-file", c]
            )
    
>       assert result.exit_code == 2
E       AssertionError: assert 1 == 2
E        +  where 1 = <Result PackageNotFoundError('invalid-package')>.exit_code

tests/unit/test_lower_bound_checker.py:125: AssertionError
_______________________________________________________________________ test_check_with_setup_py_missing_lower_bounds _______________________________________________________________________

    def test_check_with_setup_py_missing_lower_bounds():
        constraints = [
            "requests==1.0.0",
            "packaging==14.0",
            "wheel==1.0.0",
            "click==7.0.0",
        ]
        with constraints_file(constraints) as c:
            result = RUNNER.invoke(
                lower_bound_checker.check, ["--package-name", BAD_PACKAGE, "--constraints-file", c]
            )
    
>       assert result.exit_code == 2
E       AssertionError: assert 1 == 2
E        +  where 1 = <Result PackageNotFoundError('invalid-package')>.exit_code

tests/unit/test_lower_bound_checker.py:248: AssertionError
__________________________________________________________________________________ test_update_constraints __________________________________________________________________________________

    def test_update_constraints():
        with tempfile.TemporaryDirectory() as tmpdir:
            constraints_path = Path(tmpdir) / "constraints.txt"
    
            result = RUNNER.invoke(
                lower_bound_checker.update, ["--package-name", GOOD_PACKAGE, "--constraints-file", str(constraints_path)]
            )
    
>           assert result.exit_code == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = <Result PackageNotFoundError('valid-package')>.exit_code

tests/unit/test_lower_bound_checker.py:86: AssertionError
______________________________________________________________________ test_update_constraints_with_extra_constraints _______________________________________________________________________

    def test_update_constraints_with_extra_constraints():
        constraints = [
            "requests==1.0.0",
            "packaging==14.0",
            "wheel==0.41.0",
            "click==7.0.0",
            "grpcio==1.0.0",
            "pytest==6.0.0",  # additional requirement
        ]
        with constraints_file(constraints) as c:
            result = RUNNER.invoke(
                lower_bound_checker.check, ["--package-name", GOOD_PACKAGE, "--constraints-file", c]
            )
    
>       assert result.exit_code == 0
E       AssertionError: assert 1 == 0
E        +  where 1 = <Result PackageNotFoundError('valid-package')>.exit_code

tests/unit/test_lower_bound_checker.py:163: AssertionError
_______________________________________________________________________ test_check_with_constraints_file_invalid_pins _______________________________________________________________________

    def test_check_with_constraints_file_invalid_pins():
        constraints = [
            "requests==1.0.0",
            "packaging==14.0",
            "wheel==1.0.0, <2.0.0dev",  # should be ==
            "click>=7.0.0",  # should be ==
        ]
        with constraints_file(constraints) as c:
            result = RUNNER.invoke(
                lower_bound_checker.check, ["--package-name", GOOD_PACKAGE, "--constraints-file", c]
            )
    
>       assert result.exit_code == 2
E       AssertionError: assert 1 == 2
E        +  where 1 = <Result PackageNotFoundError('valid-package')>.exit_code

tests/unit/test_lower_bound_checker.py:193: AssertionError
_____________________________________________________________________ test_update_constraints_overwrites_existing_file ______________________________________________________________________

    def test_update_constraints_overwrites_existing_file():
        constraints = [
            "requests==1.0.0",
            "packaging==13.0",
            "wheel==0.42.0",
            "click==5.0.0",
        ]
        with constraints_file(constraints) as c:
            result = RUNNER.invoke(
                lower_bound_checker.update, ["--package-name", GOOD_PACKAGE, "--constraints-file", c]
            )
    
>           assert result.exit_code == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = <Result PackageNotFoundError('valid-package')>.exit_code

tests/unit/test_lower_bound_checker.py:107: AssertionError
____________________________________________________________________ test_check_with_constraints_file_different_versions ____________________________________________________________________

    def test_check_with_constraints_file_different_versions():
        constraints = [
            "requests==1.2.0",  # setup.py has 1.0.0
            "packaging==14.1",  # setup.py has 14.0
            "wheel==0.42.0",  # setup.py has 0.41.0
            "click==7.0.0",
            "grpcio==1.0.0"
        ]
        with constraints_file(constraints) as c:
            result = RUNNER.invoke(
                lower_bound_checker.check, ["--package-name", GOOD_PACKAGE, "--constraints-file", c]
            )
    
>       assert result.exit_code == 2
E       AssertionError: assert 1 == 2
E        +  where 1 = <Result PackageNotFoundError('valid-package')>.exit_code

tests/unit/test_lower_bound_checker.py:230: AssertionError
=============================================================================== 10 failed, 25 passed in 1.63s ===============================================================================
*** Error code 1

Version: 1.4.0
Python 3.9
FreeBSD 14.0

@parthea parthea self-assigned this Jan 25, 2024
@parthea parthea added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Jan 25, 2024
@parthea
Copy link
Contributor

parthea commented Jan 25, 2024

@yurivict, Thanks for reporting this issue. I was able to re-create the problem. It should be fixed in #170

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants