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 tests for Python >= 3.10 don't actually test much of anything #90

Open
briantist opened this issue Sep 29, 2023 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@briantist
Copy link
Owner

In #35 I got the tests working for Python 3.10 and 3.11.

This introduced some branching code in the definition of a MockArtifactoryPath class due to changes in pathlib (the underlying base class):

if sys.version_info.major == 3 and sys.version_info.minor >= 10:
_accessor = _artifactory_accessor
__new__ = _new__new__
_make_child = _new_make_child
_make_child_relpath = _new_make_child_relpath
else:
# in 3.9 and below Pathlib limits what members can be present in 'Path' class
__slots__ = ("auth", "verify", "cert", "session", "timeout", "_galactory_mocked_path")

Although I got the tests to "pass", it turns out that it's not working properly.

I haven't been able to completely figure out why yet, but it seems like is_dir() is always returning True and that means in our tests we end up testing nothing

if repo.is_dir() and not repo.name.endswith('.tar.gz'):

Galactory still works fine with Python 3.10 and 3.11 and I expect that will continue, but means there's even less testing than I thought 😞

I've still not made enough headway on #21 , I really need to step up testing in this project.

@briantist briantist added the bug Something isn't working label Sep 29, 2023
@briantist briantist self-assigned this Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant