Skip to content

Commit

Permalink
move tests out-of-tree
Browse files Browse the repository at this point in the history
  • Loading branch information
bollwyvl committed Apr 28, 2023
1 parent d016fdb commit 8ef249b
Show file tree
Hide file tree
Showing 113 changed files with 95 additions and 106 deletions.
4 changes: 2 additions & 2 deletions IPython/extensions/autoreload.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
``%autoreload 3``, ``%autoreload complete``
Same as 2/all, but also adds any new objects in the module. See
unit test at IPython/extensions/tests/test_autoreload.py::test_autoload_newly_added_objects
unit test at tests/extensions/tests/test_autoreload.py::test_autoload_newly_added_objects
Adding ``--print`` or ``-p`` to the ``%autoreload`` line will print autoreload activity to
standard out. ``--log`` or ``-l`` will do it to the log at INFO level; both can be used
Expand Down Expand Up @@ -573,7 +573,7 @@ def autoreload(self, line=""):
%autoreload 3 or %autoreload complete
Same as 2/all, but also but also adds any new objects in the module. See
unit test at IPython/extensions/tests/test_autoreload.py::test_autoload_newly_added_objects
unit test at tests/extensions/tests/test_autoreload.py::test_autoload_newly_added_objects
The optional arguments --print and --log control display of autoreload activity. The default
is to act silently; --print (or -p) will print out the names of modules that are being
Expand Down
10 changes: 5 additions & 5 deletions IPython/lib/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ class Audio(DisplayObject):
From a File:
>>> Audio('IPython/lib/tests/test.wav') # doctest: +SKIP
>>> Audio(filename='IPython/lib/tests/test.wav') # doctest: +SKIP
>>> Audio('tests/lib/tests/test.wav') # doctest: +SKIP
>>> Audio(filename='tests/lib/tests/test.wav') # doctest: +SKIP
From Bytes:
Expand Down Expand Up @@ -181,7 +181,7 @@ def _validate_and_normalize_with_numpy(data, normalize) -> Tuple[bytes, int]:
data = data.T.ravel()
else:
raise ValueError('Array audio input must be a 1D or 2D array')

max_abs_value = np.max(np.abs(data))
normalization_factor = Audio._get_normalization_factor(max_abs_value, normalize)
scaled = data / normalization_factor * 32767
Expand Down Expand Up @@ -249,7 +249,7 @@ def autoplay_attr(self):
return 'autoplay="autoplay"'
else:
return ''

def element_id_attr(self):
if (self.element_id):
return 'id="{element_id}"'.format(element_id=self.element_id)
Expand Down Expand Up @@ -321,7 +321,7 @@ class YouTubeVideo(IFrame):
Other parameters can be provided as documented at
https://developers.google.com/youtube/player_parameters#Parameters
When converting the notebook using nbconvert, a jpeg representation of the video
will be inserted in the document.
"""
Expand Down
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ include .flake8
include .pre-commit-config.yaml
include long_description.rst

recursive-include tests *

recursive-exclude tools *

exclude tools
exclude CONTRIBUTING.md
exclude .editorconfig
Expand Down
35 changes: 1 addition & 34 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ ignore_missing_imports = true
follow_imports = 'silent'
exclude = [
'test_\.+\.py',
'IPython.utils.tests.test_wildcard',
'testing',
'tests',
'PyColorize.py',
Expand Down Expand Up @@ -36,39 +35,7 @@ addopts = [
"--durations=10",
"-pIPython.testing.plugin.pytest_ipdoctest",
"--ipdoctest-modules",
"--ignore=docs",
"--ignore=examples",
"--ignore=htmlcov",
"--ignore=ipython_kernel",
"--ignore=ipython_parallel",
"--ignore=results",
"--ignore=tmp",
"--ignore=tools",
"--ignore=traitlets",
"--ignore=IPython/core/tests/daft_extension",
"--ignore=IPython/sphinxext",
"--ignore=IPython/terminal/pt_inputhooks",
"--ignore=IPython/__main__.py",
"--ignore=IPython/external/qt_for_kernel.py",
"--ignore=IPython/html/widgets/widget_link.py",
"--ignore=IPython/html/widgets/widget_output.py",
"--ignore=IPython/terminal/console.py",
"--ignore=IPython/utils/_process_cli.py",
"--ignore=IPython/utils/_process_posix.py",
"--ignore=IPython/utils/_process_win32.py",
"--ignore=IPython/utils/_process_win32_controller.py",
"--ignore=IPython/utils/daemonize.py",
"--ignore=IPython/utils/eventful.py",
"--ignore=IPython/kernel",
"--ignore=IPython/consoleapp.py",
"--ignore=IPython/core/inputsplitter.py",
"--ignore=IPython/lib/kernel.py",
"--ignore=IPython/utils/jsonutil.py",
"--ignore=IPython/utils/localinterfaces.py",
"--ignore=IPython/utils/log.py",
"--ignore=IPython/utils/signatures.py",
"--ignore=IPython/utils/traitlets.py",
"--ignore=IPython/utils/version.py"
"tests",
]
doctest_optionflags = [
"NORMALIZE_WHITESPACE",
Expand Down
14 changes: 7 additions & 7 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ classifiers =
Topic :: System :: Shells

[options]
packages = find:
python_requires = >=3.8
zip_safe = False
install_requires =
Expand All @@ -43,6 +42,12 @@ install_requires =
traitlets>=5
typing_extensions ; python_version<'3.10'

[options.packages.find]
exclude =
setupext
someplace
tests

[options.extras_require]
black =
black
Expand Down Expand Up @@ -96,17 +101,12 @@ all =
%(test_extra)s
%(test)s

[options.packages.find]
exclude =
setupext

[options.package_data]
IPython = py.typed
IPython.core = profile/README*
IPython.core.tests = *.png, *.jpg, daft_extension/*.py
IPython.lib.tests = *.wav
IPython.testing.plugin = *.txt


[velin]
ignore_patterns =
IPython/core/tests
Expand Down
3 changes: 0 additions & 3 deletions setupbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ def find_package_data():

package_data = {
'IPython.core' : ['profile/README*'],
'IPython.core.tests' : ['*.png', '*.jpg', 'daft_extension/*.py'],
'IPython.lib.tests' : ['*.wav'],
'IPython.testing.plugin' : ['*.txt'],
}

Expand Down Expand Up @@ -346,4 +344,3 @@ def _record_commit(self, base_dir):
)

return MyBuildPy

File renamed without changes.
6 changes: 3 additions & 3 deletions IPython/conftest.py → tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# Must register before it gets imported
pytest.register_assert_rewrite("IPython.testing.tools")

from .testing import tools
from IPython.testing import tools


def pytest_collection_modifyitems(items):
Expand All @@ -28,7 +28,7 @@ def pytest_collection_modifyitems(items):


def get_ipython():
from .terminal.interactiveshell import TerminalInteractiveShell
from IPython.terminal.interactiveshell import TerminalInteractiveShell
if TerminalInteractiveShell._instance:
return TerminalInteractiveShell.instance()

Expand Down Expand Up @@ -78,7 +78,7 @@ def inject():
builtins.ip = get_ipython()
builtins.ip.system = types.MethodType(xsys, ip)
builtins.ip.builtin_trap.activate()
from .core import page
from IPython.core import page

page.pager_page = nopage
# yield
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 @@ -11,10 +11,12 @@

with pytest.warns(DeprecationWarning, match="inputsplitter"):
from IPython.core import inputsplitter as isp

from IPython.core.inputtransformer import InputTransformer
from IPython.core.tests.test_inputtransformer import syntax, syntax_ml
from IPython.testing import tools as tt

from .test_inputtransformer import syntax, syntax_ml

#-----------------------------------------------------------------------------
# Semi-complete examples (also used as tests)
#-----------------------------------------------------------------------------
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 8ef249b

Please sign in to comment.