Skip to content

Commit

Permalink
move tests to top level
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Sep 12, 2022
1 parent d3d2f12 commit 786da12
Show file tree
Hide file tree
Showing 23 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ per-file-ignores =
# B011: Do not call assert False since python -O removes these calls
# F841 local variable 'foo' is assigned to but never used
# B007 Loop control variable
jupyter_client/tests/*: B011, F841, B007
tests/*: B011, F841, B007
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ repos:
rev: v0.971
hooks:
- id: mypy
exclude: jupyter_client/tests
exclude: tests
args: ["--config-file", "pyproject.toml"]
additional_dependencies: [pyzmq, tornado, types-paramiko]
stages: [manual]
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ src = "pyproject.toml"
[tool.pytest.ini_options]
addopts = "-raXs --durations 10 --color=yes --doctest-modules"
testpaths = [
"jupyter_client/tests/"
"jupyter_client",
"tests/"
]
timeout = 300
# Restore this setting to debug failures
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest
from IPython.utils.capture import capture_output

from ..manager import start_new_kernel
from jupyter_client.manager import start_new_kernel
from .utils import test_env
from jupyter_client.kernelspec import KernelSpecManager
from jupyter_client.kernelspec import NATIVE_KERNEL_NAME
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
from jupyter_core import paths
from traitlets.config.loader import Config

from ..manager import _ShutdownStatus
from ..manager import start_new_async_kernel
from ..manager import start_new_kernel
from jupyter_client.manager import _ShutdownStatus
from jupyter_client.manager import start_new_async_kernel
from jupyter_client.manager import start_new_kernel
from .utils import AsyncKMSubclass
from .utils import SyncKMSubclass
from jupyter_client import AsyncKernelManager
Expand Down Expand Up @@ -56,7 +56,7 @@ def _install_kernel(name="signaltest", extra_env=None):
"argv": [
sys.executable,
"-m",
"jupyter_client.tests.signalkernel",
"tests.signalkernel",
"-f",
"{connection_file}",
],
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
# -----------------------------------------------------------------------------
from .. import localinterfaces
from jupyter_client import localinterfaces


def test_load_ips():
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from tornado.testing import gen_test
from traitlets.config.loader import Config

from ..localinterfaces import localhost
from jupyter_client.localinterfaces import localhost
from .utils import AsyncKMSubclass
from .utils import AsyncMKMSubclass
from .utils import install_kernel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
from traitlets import Int
from traitlets import Unicode

from ..connect import KernelConnectionInfo
from ..kernelspec import KernelSpecManager
from ..kernelspec import NoSuchKernel
from ..launcher import launch_kernel
from ..manager import AsyncKernelManager
from ..provisioning import KernelProvisionerBase
from ..provisioning import KernelProvisionerFactory
from ..provisioning import LocalProvisioner
from jupyter_client.connect import KernelConnectionInfo
from jupyter_client.kernelspec import KernelSpecManager
from jupyter_client.kernelspec import NoSuchKernel
from jupyter_client.launcher import launch_kernel
from jupyter_client.manager import AsyncKernelManager
from jupyter_client.provisioning import KernelProvisionerBase
from jupyter_client.provisioning import KernelProvisionerFactory
from jupyter_client.provisioning import LocalProvisioner

pjoin = os.path.join

Expand Down Expand Up @@ -201,10 +201,10 @@ def akm(request, all_provisioners):
initial_provisioner_map = {
'local-provisioner': ('jupyter_client.provisioning', 'LocalProvisioner'),
'subclassed-test-provisioner': (
'jupyter_client.tests.test_provisioning',
'tests.test_provisioning',
'SubclassedTestProvisioner',
),
'custom-test-provisioner': ('jupyter_client.tests.test_provisioning', 'CustomTestProvisioner'),
'custom-test-provisioner': ('tests.test_provisioning', 'CustomTestProvisioner'),
}


Expand All @@ -218,7 +218,7 @@ def mock_get_all_provisioners() -> List[EntryPoint]:
def mock_get_provisioner(factory, name) -> EntryPoint:
if name == 'new-test-provisioner':
return EntryPoint(
'new-test-provisioner', 'jupyter_client.tests.test_provisioning', 'NewTestProvisioner'
'new-test-provisioner', 'tests.test_provisioning', 'NewTestProvisioner'
)

if name in initial_provisioner_map:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def _install_kernel(name="problemtest", extra_env=None):
"argv": [
sys.executable,
"-m",
"jupyter_client.tests.problemkernel",
"tests.problemkernel",
"-f",
"{connection_file}",
],
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions jupyter_client/tests/utils.py → tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class AsyncKMSubclass(KMSubclass, AsyncKernelManager):

class MKMSubclass(RecordCallMixin):
def _kernel_manager_class_default(self):
return "jupyter_client.tests.utils.SyncKMSubclass"
return "tests.utils.SyncKMSubclass"

@subclass_recorder
def get_kernel(self, kernel_id):
Expand Down Expand Up @@ -245,12 +245,12 @@ class SyncMKMSubclass(MKMSubclass, MultiKernelManager):
_superclass = MultiKernelManager

def _kernel_manager_class_default(self):
return "jupyter_client.tests.utils.SyncKMSubclass"
return "tests.utils.SyncKMSubclass"


class AsyncMKMSubclass(MKMSubclass, AsyncMultiKernelManager):

_superclass = AsyncMultiKernelManager

def _kernel_manager_class_default(self):
return "jupyter_client.tests.utils.AsyncKMSubclass"
return "tests.utils.AsyncKMSubclass"

0 comments on commit 786da12

Please sign in to comment.