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

'KubernetesProxy' object has no attribute 'temp_ca_file' in tests #1154

Open
dimaqq opened this issue Oct 10, 2024 · 1 comment
Open

'KubernetesProxy' object has no attribute 'temp_ca_file' in tests #1154

dimaqq opened this issue Oct 10, 2024 · 1 comment
Labels
area/tests Updates the tests or test infrastructure hint/help-wanted Extra attention is needed kind/bug indicates a bug in the project kind/test invalid or failing tests cases, build errors due to a test case, any problems regarding testing. priority/low low priority

Comments

@dimaqq
Copy link
Contributor

dimaqq commented Oct 10, 2024

Description

tests pass, but following error is reported:

Urgency

Casually reporting

Python-libjuju version

3.5.2.0

Juju version

any

Reproduce / Test

# tox -e unit

tests/unit/test_proxy_kubernetes.py::TestKubernetesProxy::test_remote_port_error
  /code/python-libjuju/.tox/py3/lib/python3.12/site-packages/_pytest/unraisableexception.py:85: PytestUnraisableExceptionWarning: Exception ignored in: <function KubernetesProxy.__del__ at 0xee3a9ca1c040>

  Traceback (most recent call last):
    File "/code/python-libjuju/juju/client/proxy/kubernetes/proxy.py", line 34, in __init__
      self.remote_port = int(remote_port)
                         ^^^^^^^^^^^^^^^^
  ValueError: invalid literal for int() with base 10: 'not-a-integer-port'

  During handling of the above exception, another exception occurred:

  ValueError: Invalid port number: not-a-integer-port

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/code/python-libjuju/juju/client/proxy/kubernetes/proxy.py", line 67, in __del__
      os.unlink(self.temp_ca_file.name)
                ^^^^^^^^^^^^^^^^^
  AttributeError: 'KubernetesProxy' object has no attribute 'temp_ca_file'

    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
@dimaqq dimaqq added kind/bug indicates a bug in the project priority/low low priority kind/test invalid or failing tests cases, build errors due to a test case, any problems regarding testing. area/tests Updates the tests or test infrastructure hint/help-wanted Extra attention is needed labels Oct 10, 2024
@dimaqq
Copy link
Contributor Author

dimaqq commented Oct 10, 2024

I believe it's a simple bug, the attribute is set conditionally on construction and removed unconditionally or something like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tests Updates the tests or test infrastructure hint/help-wanted Extra attention is needed kind/bug indicates a bug in the project kind/test invalid or failing tests cases, build errors due to a test case, any problems regarding testing. priority/low low priority
Projects
None yet
Development

No branches or pull requests

1 participant