diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 3d877f9..537e6eb 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -29,7 +29,7 @@ jobs: - name: Set up Python uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7 with: - python-version: "3.10" + python-version: "3.11" - name: Install dependencies run: | pip install -U pip diff --git a/netdiff/parsers/base.py b/netdiff/parsers/base.py index 033306f..512ca27 100644 --- a/netdiff/parsers/base.py +++ b/netdiff/parsers/base.py @@ -1,4 +1,5 @@ import json +from urllib import parse as urlparse import networkx import requests @@ -7,11 +8,6 @@ from ..exceptions import ConversionException, TopologyRetrievalError from ..utils import _netjson_networkgraph, diff -try: - import urlparse -except ImportError: # pragma: no cover - from urllib import parse as urlparse # pragma: no cover - class BaseParser(object): """ diff --git a/netdiff/parsers/cnml.py b/netdiff/parsers/cnml.py index 52d81f4..657419f 100644 --- a/netdiff/parsers/cnml.py +++ b/netdiff/parsers/cnml.py @@ -1,15 +1,11 @@ import os +from urllib import parse as urlparse import libcnml from ..exceptions import ParserError from .base import BaseParser -try: - import urlparse -except ImportError: - from urllib import parse as urlparse - class CnmlParser(BaseParser): """CNML 0.1 parser""" diff --git a/runtests.py b/runtests.py index 696a716..ef5d562 100755 --- a/runtests.py +++ b/runtests.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- try: import nose2 diff --git a/tests/test_base.py b/tests/test_base.py index 19176d4..f3afce6 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -1,5 +1,6 @@ import os import unittest +from unittest import mock import responses from requests.exceptions import ConnectionError @@ -11,11 +12,6 @@ from netdiff.parsers.base import BaseParser from netdiff.utils import _netjson_networkgraph -try: - from unittest import mock -except ImportError: - import mock - class TestBaseParser(unittest.TestCase): """BaseParser tests"""