poetry icon indicating copy to clipboard operation
poetry copied to clipboard

resolve paths before comparing

Open dotlambda opened this issue 11 months ago • 0 comments

Pull Request Check List

Resolves: test_python_get_preferred_default fails because one of the paths being compared is a symlink to the other:

______________________ test_python_get_preferred_default _______________________
[gw3] linux -- Python 3.12.8 /nix/store/c9m6yd8fg1flz2j5r4bif1ib5j20a0cy-python3-3.12.8/bin/python3.12

config = <tests.conftest.Config object at 0x7fffee6f9760>

    def test_python_get_preferred_default(config: Config) -> None:
        python = Python.get_preferred_python(config)
    
>       assert python.executable == Path(sys.executable)
E       AssertionError: assert PosixPath('/nix/store/c9m6yd8fg1flz2j5r4bif1ib5j20a0cy-python3-3.12.8/bin/python') == PosixPath('/nix/store/c9m6yd8fg1flz2j5r4bif1ib5j20a0cy-python3-3.12.8/bin/python3.12')
E        +  where PosixPath('/nix/store/c9m6yd8fg1flz2j5r4bif1ib5j20a0cy-python3-3.12.8/bin/python') = <poetry.utils.env.python_manager.Python object at 0x7fffef07acf0>.executable
E        +  and   PosixPath('/nix/store/c9m6yd8fg1flz2j5r4bif1ib5j20a0cy-python3-3.12.8/bin/python3.12') = Path('/nix/store/c9m6yd8fg1flz2j5r4bif1ib5j20a0cy-python3-3.12.8/bin/python3.12')
E        +    where '/nix/store/c9m6yd8fg1flz2j5r4bif1ib5j20a0cy-python3-3.12.8/bin/python3.12' = sys.executable
  • [ ] Added tests for changed code.
  • [ ] Updated documentation for changed code.

dotlambda avatar Jan 05 '25 13:01 dotlambda