Skip to content

Fix python3 deprecation warnings#585

Merged
brian-brazil merged 2 commits into
prometheus:masterfrom
yzdann:fix-deprecation-warnings
Oct 2, 2020
Merged

Fix python3 deprecation warnings#585
brian-brazil merged 2 commits into
prometheus:masterfrom
yzdann:fix-deprecation-warnings

Conversation

@yzdann

@yzdann yzdann commented Oct 2, 2020

Copy link
Copy Markdown
Contributor

Fix DeprecationWarning for inspect.getargspec() and assertEquals.

travis build warnings.

=============================== warnings summary ===============================

tests/test_core.py::TestCounter::test_function_decorator

  /home/travis/build/prometheus/client_python/tests/test_core.py:49: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()

    self.assertEqual((["r"], None, None, None), inspect.getargspec(f))

tests/test_core.py::TestGauge::test_inprogress_function_decorator

  /home/travis/build/prometheus/client_python/tests/test_core.py:110: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()

    self.assertEqual(([], None, None, None), inspect.getargspec(f))

tests/test_core.py::TestGauge::test_time_function_decorator

  /home/travis/build/prometheus/client_python/tests/test_core.py:137: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()

    self.assertEqual(([], None, None, None), inspect.getargspec(f))

tests/test_core.py::TestSummary::test_function_decorator

  /home/travis/build/prometheus/client_python/tests/test_core.py:207: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()

    self.assertEqual(([], None, None, None), inspect.getargspec(f))

tests/test_core.py::TestHistogram::test_function_decorator

  /home/travis/build/prometheus/client_python/tests/test_core.py:348: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()

    self.assertEqual(([], None, None, None), inspect.getargspec(f))

tests/test_core.py::TestCollectorRegistry::test_restricted_registry

  /home/travis/build/prometheus/client_python/tests/test_core.py:755: DeprecationWarning: Please use assertEqual instead.

    self.assertEquals([m], registry.restricted_registry(['s_sum']).collect())

tests/test_core.py::TestCollectorRegistry::test_target_info_restricted_registry

  /home/travis/build/prometheus/client_python/tests/test_core.py:779: DeprecationWarning: Please use assertEqual instead.

    self.assertEquals([m], registry.restricted_registry(['s_sum']).collect())

tests/test_core.py::TestCollectorRegistry::test_target_info_restricted_registry

  /home/travis/build/prometheus/client_python/tests/test_core.py:783: DeprecationWarning: Please use assertEqual instead.

    self.assertEquals([m], registry.restricted_registry(['target_info']).collect())

-- Docs: https://docs.pytest.org/en/stable/warnings.html

================== 251 passed, 5 skipped, 8 warnings in 4.38s ==================

yzdann added 2 commits October 2, 2020 11:41
Signed-off-by: yzdann <22779039+yzdann@users.noreply.github.com>
…ecation

Signed-off-by: yzdann <22779039+yzdann@users.noreply.github.com>
@yzdann yzdann changed the title Change assertEquals to assertEqual due to deprecation Fix python3 deprecation warnings Oct 2, 2020
@brian-brazil brian-brazil merged commit af6bfd3 into prometheus:master Oct 2, 2020
@brian-brazil

Copy link
Copy Markdown
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants