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

Hid HTTP request logs in tests; fixed a deprecation warning #147

Merged
merged 3 commits into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[metadata]
description-file = README.md
description_file = README.md
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixes the following deprecation warning

/root/dev/repos/simple/.venv/lib/python3.8/site-packages/setuptools/dist.py:472: SetuptoolsDeprecationWarning: Invalid dash-separated options
!!

        ********************************************************************************
        Usage of dash-separated 'description-file' will not be supported in future
        versions. Please use the underscore name 'description_file' instead.

        By 2024-Sep-26, you need to update your project and remove deprecated calls
        or your builds will no longer be supported.

        See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
        ********************************************************************************

!!
  opt = self.warn_dash_deprecation(opt, section)

1 change: 0 additions & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ click
coverage
coveralls
docopt
enum34
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes a deprecation warning:

/root/dev/repos/simple/.venv/lib/python3.8/site-packages/setuptools/installer.py:44: UserWarning: Module enum was already imported from /usr/lib/python3.8/enum.py, but /root/dev/repos/virlutils/.eggs/enum34-1.1.10-py3.8.egg is being added to sys.path
  pkg_resources.working_set.add(dist, replace=True)

flake8
funcsigs
gunicorn
Expand Down
6 changes: 6 additions & 0 deletions tests/v2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import os
import unittest
from click.testing import CliRunner
Expand All @@ -12,6 +13,11 @@
from virl2_client import ClientLibrary


# set to warning to hide unwanted HTTP requests
logger = logging.getLogger("httpx")
logger.setLevel(logging.WARNING)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

httpx logs unnecessary HTTP requests while testing (imo not needed)

HTTP Request: GET https://localhost/api/v0/system_information "HTTP/1.1 200 OK"
HTTP Request: POST https://localhost/api/v0/authenticate "HTTP/1.1 200 OK"
HTTP Request: GET https://localhost/api/v0/authok "HTTP/1.1 200 OK"
HTTP Request: GET https://localhost/api/v0/populate_lab_tiles "HTTP/1.1 200 OK"
HTTP Request: GET https://localhost/api/v0/labs/5f0d96/topology "HTTP/1.1 200 OK"



def setup_cml_environ():
os.environ["VIRL_HOST"] = "localhost"
os.environ["VIRL_USERNAME"] = "admin"
Expand Down
Loading