Show More
@@ -16,12 +16,23 b' jobs:' | |||||
16 | matrix: |
|
16 | matrix: | |
17 | os: [ubuntu-latest] |
|
17 | os: [ubuntu-latest] | |
18 | python-version: ["3.7", "3.8", "3.9", "3.10"] |
|
18 | python-version: ["3.7", "3.8", "3.9", "3.10"] | |
|
19 | deps: [test_extra] | |||
19 | # Test all on ubuntu, test ends on macos |
|
20 | # Test all on ubuntu, test ends on macos | |
20 | include: |
|
21 | include: | |
21 | - os: macos-latest |
|
22 | - os: macos-latest | |
22 | python-version: "3.7" |
|
23 | python-version: "3.7" | |
|
24 | deps: test_extra | |||
23 | - os: macos-latest |
|
25 | - os: macos-latest | |
24 | python-version: "3.10" |
|
26 | python-version: "3.10" | |
|
27 | deps: test_extra | |||
|
28 | # Tests minimal dependencies set | |||
|
29 | - os: ubuntu-latest | |||
|
30 | python-version: "3.10" | |||
|
31 | deps: test | |||
|
32 | # Tests latest development Python version | |||
|
33 | - os: ubuntu-latest | |||
|
34 | python-version: "3.11-dev" | |||
|
35 | deps: test | |||
25 |
|
36 | |||
26 | steps: |
|
37 | steps: | |
27 | - uses: actions/checkout@v2 |
|
38 | - uses: actions/checkout@v2 | |
@@ -30,15 +41,13 b' jobs:' | |||||
30 | with: |
|
41 | with: | |
31 | python-version: ${{ matrix.python-version }} |
|
42 | python-version: ${{ matrix.python-version }} | |
32 | - name: Install latex |
|
43 | - name: Install latex | |
33 | if: runner.os == 'Linux' |
|
44 | if: runner.os == 'Linux' && matrix.deps == 'test_extra' | |
34 | run: sudo apt-get -yq -o Acquire::Retries=3 --no-install-suggests --no-install-recommends install texlive dvipng |
|
45 | run: sudo apt-get -yq -o Acquire::Retries=3 --no-install-suggests --no-install-recommends install texlive dvipng | |
35 | - name: Install and update Python dependencies |
|
46 | - name: Install and update Python dependencies | |
36 | run: | |
|
47 | run: | | |
37 | python -m pip install --upgrade pip setuptools wheel |
|
48 | python -m pip install --upgrade pip setuptools wheel | |
38 |
python -m pip install --upgrade -e |
|
49 | python -m pip install --upgrade -e .[${{ matrix.deps }}] | |
39 |
python -m pip install --upgrade |
|
50 | python -m pip install --upgrade check-manifest pytest-cov | |
40 | python -m pip install --upgrade pytest pytest-cov pytest-trio 'matplotlib!=3.2.0' pandas |
|
|||
41 | python -m pip install --upgrade check-manifest pytest-cov anyio |
|
|||
42 | - name: Check manifest |
|
51 | - name: Check manifest | |
43 | run: check-manifest |
|
52 | run: check-manifest | |
44 | - name: pytest |
|
53 | - name: pytest |
@@ -104,7 +104,7 b' def test_unicode_range():' | |||||
104 | assert len_exp == len_test, message |
|
104 | assert len_exp == len_test, message | |
105 |
|
105 | |||
106 | # fail if new unicode symbols have been added. |
|
106 | # fail if new unicode symbols have been added. | |
107 |
assert len_exp <= 13 |
|
107 | assert len_exp <= 138552, message | |
108 |
|
108 | |||
109 |
|
109 | |||
110 | @contextmanager |
|
110 | @contextmanager | |
@@ -219,6 +219,11 b' class KeyCompletable:' | |||||
219 | return list(self.things) |
|
219 | return list(self.things) | |
220 |
|
220 | |||
221 |
|
221 | |||
|
222 | @pytest.mark.xfail( | |||
|
223 | sys.version_info >= (3, 11), | |||
|
224 | reason="parso does not support 3.11 yet", | |||
|
225 | raises=NotImplementedError, | |||
|
226 | ) | |||
222 | class TestCompleter(unittest.TestCase): |
|
227 | class TestCompleter(unittest.TestCase): | |
223 | def setUp(self): |
|
228 | def setUp(self): | |
224 | """ |
|
229 | """ | |
@@ -282,7 +287,7 b' class TestCompleter(unittest.TestCase):' | |||||
282 |
|
287 | |||
283 | ip = get_ipython() |
|
288 | ip = get_ipython() | |
284 | # Test some random unicode symbols |
|
289 | # Test some random unicode symbols | |
285 |
keys = random.sample(latex_symbols |
|
290 | keys = random.sample(sorted(latex_symbols), 10) | |
286 | for k in keys: |
|
291 | for k in keys: | |
287 | text, matches = ip.complete(k) |
|
292 | text, matches = ip.complete(k) | |
288 | self.assertEqual(text, k) |
|
293 | self.assertEqual(text, k) |
@@ -156,7 +156,6 b' def _get_inline_config():' | |||||
156 | return InlineBackend.instance() |
|
156 | return InlineBackend.instance() | |
157 |
|
157 | |||
158 |
|
158 | |||
159 | @dec.skip_without("ipykernel") |
|
|||
160 | @dec.skip_without("matplotlib") |
|
159 | @dec.skip_without("matplotlib") | |
161 | def test_set_matplotlib_close(): |
|
160 | def test_set_matplotlib_close(): | |
162 | cfg = _get_inline_config() |
|
161 | cfg = _get_inline_config() | |
@@ -196,7 +195,6 b' def test_set_matplotlib_formats():' | |||||
196 | assert Figure not in f |
|
195 | assert Figure not in f | |
197 |
|
196 | |||
198 |
|
197 | |||
199 | @dec.skip_without("ipykernel") |
|
|||
200 | @dec.skip_without("matplotlib") |
|
198 | @dec.skip_without("matplotlib") | |
201 | def test_set_matplotlib_formats_kwargs(): |
|
199 | def test_set_matplotlib_formats_kwargs(): | |
202 | from matplotlib.figure import Figure |
|
200 | from matplotlib.figure import Figure |
@@ -6,13 +6,13 b'' | |||||
6 | # Distributed under the terms of the Modified BSD License. |
|
6 | # Distributed under the terms of the Modified BSD License. | |
7 |
|
7 | |||
8 | import unittest |
|
8 | import unittest | |
|
9 | import pytest | |||
9 | import sys |
|
10 | import sys | |
10 |
|
11 | |||
11 | from IPython.core import inputsplitter as isp |
|
12 | from IPython.core import inputsplitter as isp | |
12 | from IPython.core.inputtransformer import InputTransformer |
|
13 | from IPython.core.inputtransformer import InputTransformer | |
13 | from IPython.core.tests.test_inputtransformer import syntax, syntax_ml |
|
14 | from IPython.core.tests.test_inputtransformer import syntax, syntax_ml | |
14 | from IPython.testing import tools as tt |
|
15 | from IPython.testing import tools as tt | |
15 | from IPython.testing.decorators import skipif |
|
|||
16 |
|
16 | |||
17 | #----------------------------------------------------------------------------- |
|
17 | #----------------------------------------------------------------------------- | |
18 | # Semi-complete examples (also used as tests) |
|
18 | # Semi-complete examples (also used as tests) | |
@@ -318,7 +318,12 b' class InputSplitterTestCase(unittest.TestCase):' | |||||
318 | self.isp.push(u'\xc3\xa9') |
|
318 | self.isp.push(u'\xc3\xa9') | |
319 | self.isp.push(u"u'\xc3\xa9'") |
|
319 | self.isp.push(u"u'\xc3\xa9'") | |
320 |
|
320 | |||
321 | @skipif(sys.version_info[:3] == (3, 9, 8)) |
|
321 | @pytest.mark.xfail( | |
|
322 | reason="Bug in python 3.9.8 – bpo 45738", | |||
|
323 | condition=sys.version_info in [(3, 9, 8, "final", 0), (3, 11, 0, "alpha", 2)], | |||
|
324 | raises=SystemError, | |||
|
325 | strict=True, | |||
|
326 | ) | |||
322 | def test_line_continuation(self): |
|
327 | def test_line_continuation(self): | |
323 | """ Test issue #2108.""" |
|
328 | """ Test issue #2108.""" | |
324 | isp = self.isp |
|
329 | isp = self.isp |
@@ -275,7 +275,8 b' examples = [' | |||||
275 | None, |
|
275 | None, | |
276 | marks=pytest.mark.xfail( |
|
276 | marks=pytest.mark.xfail( | |
277 | reason="Bug in python 3.9.8 – bpo 45738", |
|
277 | reason="Bug in python 3.9.8 – bpo 45738", | |
278 |
condition=sys.version_info |
|
278 | condition=sys.version_info | |
|
279 | in [(3, 9, 8, "final", 0), (3, 11, 0, "alpha", 2)], | |||
279 | raises=SystemError, |
|
280 | raises=SystemError, | |
280 | strict=True, |
|
281 | strict=True, | |
281 | ), |
|
282 | ), | |
@@ -292,7 +293,9 b' def test_check_complete_param(code, expected, number):' | |||||
292 |
|
293 | |||
293 | @pytest.mark.xfail( |
|
294 | @pytest.mark.xfail( | |
294 | reason="Bug in python 3.9.8 – bpo 45738", |
|
295 | reason="Bug in python 3.9.8 – bpo 45738", | |
295 |
condition=sys.version_info[ |
|
296 | condition=sys.version_info in [(3, 9, 8, "final", 0), (3, 11, 0, "alpha", 2)], | |
|
297 | raises=SystemError, | |||
|
298 | strict=True, | |||
296 | ) |
|
299 | ) | |
297 | def test_check_complete(): |
|
300 | def test_check_complete(): | |
298 | cc = ipt2.TransformerManager().check_complete |
|
301 | cc = ipt2.TransformerManager().check_complete |
@@ -742,6 +742,7 b' def test_extension():' | |||||
742 |
|
742 | |||
743 |
|
743 | |||
744 | def test_notebook_export_json(): |
|
744 | def test_notebook_export_json(): | |
|
745 | pytest.importorskip("nbformat") | |||
745 | _ip = get_ipython() |
|
746 | _ip = get_ipython() | |
746 | _ip.history_manager.reset() # Clear any existing history. |
|
747 | _ip.history_manager.reset() # Clear any existing history. | |
747 | cmds = ["a=1", "def b():\n return a**2", "print('noël, été', b())"] |
|
748 | cmds = ["a=1", "def b():\n return a**2", "print('noël, été', b())"] |
@@ -269,7 +269,6 b' def test_empty_property_has_no_source():' | |||||
269 |
|
269 | |||
270 |
|
270 | |||
271 | def test_property_sources(): |
|
271 | def test_property_sources(): | |
272 | import posixpath |
|
|||
273 | # A simple adder whose source and signature stays |
|
272 | # A simple adder whose source and signature stays | |
274 | # the same across Python distributions |
|
273 | # the same across Python distributions | |
275 | def simple_add(a, b): |
|
274 | def simple_add(a, b): | |
@@ -283,7 +282,7 b' def test_property_sources():' | |||||
283 |
|
282 | |||
284 | foo = foo.setter(lambda self, v: setattr(self, 'bar', v)) |
|
283 | foo = foo.setter(lambda self, v: setattr(self, 'bar', v)) | |
285 |
|
284 | |||
286 |
dname = property( |
|
285 | dname = property(oinspect.getdoc) | |
287 | adder = property(simple_add) |
|
286 | adder = property(simple_add) | |
288 |
|
287 | |||
289 | i = inspector.info(A.foo, detail_level=1) |
|
288 | i = inspector.info(A.foo, detail_level=1) | |
@@ -291,7 +290,7 b' def test_property_sources():' | |||||
291 | assert "lambda self, v:" in i["source"] |
|
290 | assert "lambda self, v:" in i["source"] | |
292 |
|
291 | |||
293 | i = inspector.info(A.dname, detail_level=1) |
|
292 | i = inspector.info(A.dname, detail_level=1) | |
294 |
assert "def |
|
293 | assert "def getdoc(obj)" in i["source"] | |
295 |
|
294 | |||
296 | i = inspector.info(A.adder, detail_level=1) |
|
295 | i = inspector.info(A.adder, detail_level=1) | |
297 | assert "def simple_add(a, b)" in i["source"] |
|
296 | assert "def simple_add(a, b)" in i["source"] |
@@ -381,6 +381,7 b' tclass.py: deleting object: C-third' | |||||
381 |
|
381 | |||
382 | def test_run_nb(self): |
|
382 | def test_run_nb(self): | |
383 | """Test %run notebook.ipynb""" |
|
383 | """Test %run notebook.ipynb""" | |
|
384 | pytest.importorskip("nbformat") | |||
384 | from nbformat import v4, writes |
|
385 | from nbformat import v4, writes | |
385 | nb = v4.new_notebook( |
|
386 | nb = v4.new_notebook( | |
386 | cells=[ |
|
387 | cells=[ | |
@@ -397,6 +398,7 b' tclass.py: deleting object: C-third' | |||||
397 |
|
398 | |||
398 | def test_run_nb_error(self): |
|
399 | def test_run_nb_error(self): | |
399 | """Test %run notebook.ipynb error""" |
|
400 | """Test %run notebook.ipynb error""" | |
|
401 | pytest.importorskip("nbformat") | |||
400 | from nbformat import v4, writes |
|
402 | from nbformat import v4, writes | |
401 | # %run when a file name isn't provided |
|
403 | # %run when a file name isn't provided | |
402 | pytest.raises(Exception, _ip.magic, "run") |
|
404 | pytest.raises(Exception, _ip.magic, "run") |
@@ -66,6 +66,9 b' class Audio(DisplayObject):' | |||||
66 | Examples |
|
66 | Examples | |
67 | -------- |
|
67 | -------- | |
68 |
|
68 | |||
|
69 | >>> import pytest | |||
|
70 | >>> np = pytest.importorskip("numpy") | |||
|
71 | ||||
69 | Generate a sound |
|
72 | Generate a sound | |
70 |
|
73 | |||
71 | >>> import numpy as np |
|
74 | >>> import numpy as np |
@@ -3,6 +3,7 b'' | |||||
3 | # Copyright (c) IPython Development Team. |
|
3 | # Copyright (c) IPython Development Team. | |
4 | # Distributed under the terms of the Modified BSD License. |
|
4 | # Distributed under the terms of the Modified BSD License. | |
5 |
|
5 | |||
|
6 | import pytest | |||
6 | import IPython.testing.tools as tt |
|
7 | import IPython.testing.tools as tt | |
7 |
|
8 | |||
8 |
|
9 | |||
@@ -25,4 +26,5 b' def test_locate_profile_help():' | |||||
25 | tt.help_all_output_test("locate profile") |
|
26 | tt.help_all_output_test("locate profile") | |
26 |
|
27 | |||
27 | def test_trust_help(): |
|
28 | def test_trust_help(): | |
|
29 | pytest.importorskip("nbformat") | |||
28 | tt.help_all_output_test("trust") |
|
30 | tt.help_all_output_test("trust") |
@@ -31,8 +31,8 b' init:' | |||||
31 | install: |
|
31 | install: | |
32 | - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" |
|
32 | - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" | |
33 | - python -m pip install --upgrade setuptools pip |
|
33 | - python -m pip install --upgrade setuptools pip | |
34 | - pip install pytest pytest-cov pytest-trio matplotlib pandas |
|
34 | - pip install pytest-cov | |
35 | - pip install -e .[test] |
|
35 | - pip install -e .[test_extra] | |
36 | test_script: |
|
36 | test_script: | |
37 | - pytest --color=yes -ra --cov --cov-report=xml |
|
37 | - pytest --color=yes -ra --cov --cov-report=xml | |
38 | on_finish: |
|
38 | on_finish: |
@@ -176,12 +176,19 b' extras_require = dict(' | |||||
176 | doc=["Sphinx>=1.3"], |
|
176 | doc=["Sphinx>=1.3"], | |
177 | test=[ |
|
177 | test=[ | |
178 | "pytest", |
|
178 | "pytest", | |
179 | "requests", |
|
|||
180 | "testpath", |
|
179 | "testpath", | |
181 | "pygments", |
|
180 | "pygments", | |
|
181 | ], | |||
|
182 | test_extra=[ | |||
|
183 | "pytest", | |||
|
184 | "testpath", | |||
|
185 | "curio", | |||
|
186 | "matplotlib!=3.2.0", | |||
182 | "nbformat", |
|
187 | "nbformat", | |
183 | "ipykernel", |
|
|||
184 | "numpy>=1.17", |
|
188 | "numpy>=1.17", | |
|
189 | "pandas", | |||
|
190 | "pygments", | |||
|
191 | "trio", | |||
185 | ], |
|
192 | ], | |
186 | terminal=[], |
|
193 | terminal=[], | |
187 | kernel=["ipykernel"], |
|
194 | kernel=["ipykernel"], |
General Comments 0
You need to be logged in to leave comments.
Login now