Unverified Commit fc46517c authored by Duncan Macleod's avatar Duncan Macleod
Browse files

remove use of mock package

use unittest.mock throughout
parent aea1745b
Pipeline #458372 passed with stages
in 6 minutes and 8 seconds
......@@ -2,10 +2,7 @@
# Ex: 'gracedb add event'
import pytest
import shlex
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
# Apply module-level mark
pytestmark = pytest.mark.cli
......
......@@ -4,10 +4,7 @@ import datetime
import pytest
import shlex
import six
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
# Apply module-level mark
pytestmark = pytest.mark.cli
......
......@@ -2,10 +2,7 @@
# Ex: 'gracedb delete signoff'
import pytest
import shlex
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
# Apply module-level mark
pytestmark = pytest.mark.cli
......
......@@ -2,10 +2,7 @@
# Ex: 'gracedb get superevent'
import pytest
import shlex
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
# Apply module-level mark
pytestmark = pytest.mark.cli
......
......@@ -3,10 +3,7 @@
# NOT 'gracedb confirm_as_gw' because it has no subcommands.
import re
import pytest
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
# Apply module-level mark
pytestmark = pytest.mark.cli
......
......@@ -3,10 +3,7 @@
# NOT 'gracedb add' because it has subcommands like 'gracedb add event'
import pytest
import six
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
from ligo.gracedb.cli.commands.subcommands import InfoCommand
......
# Tests for level 2 subcommand help
# Ex: 'gracedb add event'
import pytest
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
from .test_level1_commands import COMMANDS_TEST_DATA
......
......@@ -2,10 +2,7 @@
# Ex: 'gracedb list labels'
import pytest
import shlex
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
# Apply module-level mark
pytestmark = pytest.mark.cli
......
......@@ -2,10 +2,7 @@
# Ex: 'gracedb remove event'
import pytest
import shlex
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
# Apply module-level mark
pytestmark = pytest.mark.cli
......
......@@ -2,10 +2,7 @@
# Ex: 'gracedb create emobservation'
import pytest
import shlex
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
# Apply module-level mark
pytestmark = pytest.mark.cli
......
......@@ -2,10 +2,7 @@
# Ex: 'gracedb create emobservation'
import pytest
import shlex
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
# Apply module-level mark
pytestmark = pytest.mark.cli
......
import re
import pytest
import six
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
# Add module-level mark
pytestmark = pytest.mark.cli
......
import json
import pytest
# import six
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
from ligo.gracedb.exceptions import HTTPError
from requests import Response
......
import datetime
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
from cryptography import x509
from cryptography.x509.oid import NameOID
......
import itertools
import pytest
try:
from unittest import mock
except ImportError: # py < 3
import mock
from unittest import mock
from ligo.gracedb.rest import GraceDb
from ligo.gracedb.cert import check_certificate_expiration
......
try:
from unittest import mock
except ImportError: # python < 3
import mock
from unittest import mock
import pytest
......
try:
from unittest import mock
except ImportError: # python < 3
import mock
from unittest import mock
import six
import pytest
......
try:
from unittest import mock
except ImportError: # python < 3
import mock
import os
from unittest import mock
import pytest
......
try:
from unittest import mock
except ImportError: # python < 3
import mock
from unittest import mock
import pytest
......
import logging
try:
from unittest import mock
except ImportError: # py < 3
import mock
import time
import types
from unittest import mock
from ligo.gracedb.logging import GraceDbLogHandler
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment