##// END OF EJS Templates
Merge pull request #13303 from Kojoley/remove-skip_iptest_but_not_pytest...
Matthias Bussonnier -
r27111:6a25628e merge
parent child Browse files
Show More
@@ -12,7 +12,6 b' import pytest'
12
12
13 from IPython.core import inputtransformer2 as ipt2
13 from IPython.core import inputtransformer2 as ipt2
14 from IPython.core.inputtransformer2 import _find_assign_op, make_tokens_by_line
14 from IPython.core.inputtransformer2 import _find_assign_op, make_tokens_by_line
15 from IPython.testing.decorators import skip_iptest_but_not_pytest
16
15
17 MULTILINE_MAGIC = ("""\
16 MULTILINE_MAGIC = ("""\
18 a = f()
17 a = f()
@@ -285,14 +284,12 b' examples = ['
285 ]
284 ]
286
285
287
286
288 @skip_iptest_but_not_pytest
289 @pytest.mark.parametrize("code, expected, number", examples)
287 @pytest.mark.parametrize("code, expected, number", examples)
290 def test_check_complete_param(code, expected, number):
288 def test_check_complete_param(code, expected, number):
291 cc = ipt2.TransformerManager().check_complete
289 cc = ipt2.TransformerManager().check_complete
292 assert cc(code) == (expected, number)
290 assert cc(code) == (expected, number)
293
291
294
292
295 @skip_iptest_but_not_pytest
296 @pytest.mark.xfail(
293 @pytest.mark.xfail(
297 reason="Bug in python 3.9.8 – bpo 45738",
294 reason="Bug in python 3.9.8 – bpo 45738",
298 condition=sys.version_info[:3] == (3, 9, 8),
295 condition=sys.version_info[:3] == (3, 9, 8),
@@ -972,7 +972,6 b' def event_loop():'
972 yield asyncio.get_event_loop_policy().get_event_loop()
972 yield asyncio.get_event_loop_policy().get_event_loop()
973
973
974
974
975 @dec.skip_iptest_but_not_pytest
976 @dec.skip_win32
975 @dec.skip_win32
977 @pytest.mark.skipif(
976 @pytest.mark.skipif(
978 sys.platform == "win32", reason="This test does not run under Windows"
977 sys.platform == "win32", reason="This test does not run under Windows"
@@ -986,7 +985,6 b' def test_script_out(event_loop):'
986 assert ip.user_ns["output"] == "hi\n"
985 assert ip.user_ns["output"] == "hi\n"
987
986
988
987
989 @dec.skip_iptest_but_not_pytest
990 @dec.skip_win32
988 @dec.skip_win32
991 @pytest.mark.skipif(
989 @pytest.mark.skipif(
992 sys.platform == "win32", reason="This test does not run under Windows"
990 sys.platform == "win32", reason="This test does not run under Windows"
@@ -999,7 +997,6 b' def test_script_err(event_loop):'
999 assert ip.user_ns["error"] == "hello\n"
997 assert ip.user_ns["error"] == "hello\n"
1000
998
1001
999
1002 @dec.skip_iptest_but_not_pytest
1003 @dec.skip_win32
1000 @dec.skip_win32
1004 @pytest.mark.skipif(
1001 @pytest.mark.skipif(
1005 sys.platform == "win32", reason="This test does not run under Windows"
1002 sys.platform == "win32", reason="This test does not run under Windows"
@@ -1014,7 +1011,6 b' def test_script_out_err():'
1014 assert ip.user_ns["error"] == "hello\n"
1011 assert ip.user_ns["error"] == "hello\n"
1015
1012
1016
1013
1017 @dec.skip_iptest_but_not_pytest
1018 @dec.skip_win32
1014 @dec.skip_win32
1019 @pytest.mark.skipif(
1015 @pytest.mark.skipif(
1020 sys.platform == "win32", reason="This test does not run under Windows"
1016 sys.platform == "win32", reason="This test does not run under Windows"
@@ -1027,7 +1023,6 b' async def test_script_bg_out(event_loop):'
1027 event_loop.stop()
1023 event_loop.stop()
1028
1024
1029
1025
1030 @dec.skip_iptest_but_not_pytest
1031 @dec.skip_win32
1026 @dec.skip_win32
1032 @pytest.mark.skipif(
1027 @pytest.mark.skipif(
1033 sys.platform == "win32", reason="This test does not run under Windows"
1028 sys.platform == "win32", reason="This test does not run under Windows"
@@ -1039,7 +1034,6 b' async def test_script_bg_err():'
1039 ip.user_ns["error"].close()
1034 ip.user_ns["error"].close()
1040
1035
1041
1036
1042 @dec.skip_iptest_but_not_pytest
1043 @dec.skip_win32
1037 @dec.skip_win32
1044 @pytest.mark.skipif(
1038 @pytest.mark.skipif(
1045 sys.platform == "win32", reason="This test does not run under Windows"
1039 sys.platform == "win32", reason="This test does not run under Windows"
@@ -11,13 +11,11 b' from IPython.lib import latextools'
11 from IPython.testing.decorators import (
11 from IPython.testing.decorators import (
12 onlyif_cmds_exist,
12 onlyif_cmds_exist,
13 skipif_not_matplotlib,
13 skipif_not_matplotlib,
14 skip_iptest_but_not_pytest,
15 )
14 )
16 from IPython.utils.process import FindCmdError
15 from IPython.utils.process import FindCmdError
17
16
18
17
19 @pytest.mark.parametrize('command', ['latex', 'dvipng'])
18 @pytest.mark.parametrize('command', ['latex', 'dvipng'])
20 @skip_iptest_but_not_pytest
21 def test_check_latex_to_png_dvipng_fails_when_no_cmd(command):
19 def test_check_latex_to_png_dvipng_fails_when_no_cmd(command):
22 def mock_find_cmd(arg):
20 def mock_find_cmd(arg):
23 if arg == command:
21 if arg == command:
@@ -32,7 +30,6 b' def no_op(*args, **kwargs):'
32 yield
30 yield
33
31
34
32
35 @skip_iptest_but_not_pytest
36 @onlyif_cmds_exist("latex", "dvipng")
33 @onlyif_cmds_exist("latex", "dvipng")
37 @pytest.mark.parametrize("s, wrap", [(u"$$x^2$$", False), (u"x^2", True)])
34 @pytest.mark.parametrize("s, wrap", [(u"$$x^2$$", False), (u"x^2", True)])
38 def test_latex_to_png_dvipng_runs(s, wrap):
35 def test_latex_to_png_dvipng_runs(s, wrap):
@@ -60,7 +57,6 b' def patch_latextool(mock=mock_kpsewhich):'
60
57
61 @pytest.mark.parametrize('context', [no_op, patch_latextool])
58 @pytest.mark.parametrize('context', [no_op, patch_latextool])
62 @pytest.mark.parametrize('s_wrap', [("$x^2$", False), ("x^2", True)])
59 @pytest.mark.parametrize('s_wrap', [("$x^2$", False), ("x^2", True)])
63 @skip_iptest_but_not_pytest
64 def test_latex_to_png_mpl_runs(s_wrap, context):
60 def test_latex_to_png_mpl_runs(s_wrap, context):
65 """
61 """
66 Test that latex_to_png_mpl just runs without error.
62 Test that latex_to_png_mpl just runs without error.
@@ -16,7 +16,6 b' import unittest'
16 import pytest
16 import pytest
17
17
18 from IPython.lib import pretty
18 from IPython.lib import pretty
19 from IPython.testing.decorators import skip_iptest_but_not_pytest
20
19
21 from io import StringIO
20 from io import StringIO
22
21
@@ -129,7 +128,6 b' def test_callability_checking():'
129 ],
128 ],
130 ),
129 ),
131 )
130 )
132 @skip_iptest_but_not_pytest
133 def test_sets(obj, expected_output):
131 def test_sets(obj, expected_output):
134 """
132 """
135 Test that set and frozenset use Python 3 formatting.
133 Test that set and frozenset use Python 3 formatting.
@@ -149,17 +149,6 b' def make_label_dec(label, ds=None):'
149 return decor
149 return decor
150
150
151
151
152 def skip_iptest_but_not_pytest(f):
153 """
154 Warning this will make the test invisible to iptest.
155 """
156 import os
157
158 if os.environ.get("IPTEST_WORKING_DIR", None) is not None:
159 f.__test__ = False
160 return f
161
162
163 def skipif(skip_condition, msg=None):
152 def skipif(skip_condition, msg=None):
164 """Make function raise SkipTest exception if skip_condition is true
153 """Make function raise SkipTest exception if skip_condition is true
165
154
@@ -17,8 +17,6 b' import sys'
17
17
18 import pytest
18 import pytest
19
19
20 from IPython.testing.decorators import skip_iptest_but_not_pytest
21
22 from IPython.utils import capture
20 from IPython.utils import capture
23
21
24 #-----------------------------------------------------------------------------
22 #-----------------------------------------------------------------------------
@@ -69,7 +67,6 b' hello_stderr = "hello, stderr"'
69 # Test Functions
67 # Test Functions
70 #-----------------------------------------------------------------------------
68 #-----------------------------------------------------------------------------
71 @pytest.mark.parametrize("method_mime", _mime_map.items())
69 @pytest.mark.parametrize("method_mime", _mime_map.items())
72 @skip_iptest_but_not_pytest
73 def test_rich_output_empty(method_mime):
70 def test_rich_output_empty(method_mime):
74 """RichOutput with no args"""
71 """RichOutput with no args"""
75 rich = capture.RichOutput()
72 rich = capture.RichOutput()
@@ -88,7 +85,6 b' def test_rich_output():'
88 assert rich._repr_svg_() is None
85 assert rich._repr_svg_() is None
89
86
90
87
91 @skip_iptest_but_not_pytest
92 @pytest.mark.parametrize("method_mime", _mime_map.items())
88 @pytest.mark.parametrize("method_mime", _mime_map.items())
93 def test_rich_output_no_metadata(method_mime):
89 def test_rich_output_no_metadata(method_mime):
94 """test RichOutput with no metadata"""
90 """test RichOutput with no metadata"""
@@ -98,7 +94,6 b' def test_rich_output_no_metadata(method_mime):'
98 assert getattr(rich, method)() == data[mime]
94 assert getattr(rich, method)() == data[mime]
99
95
100
96
101 @skip_iptest_but_not_pytest
102 @pytest.mark.parametrize("method_mime", _mime_map.items())
97 @pytest.mark.parametrize("method_mime", _mime_map.items())
103 def test_rich_output_metadata(method_mime):
98 def test_rich_output_metadata(method_mime):
104 """test RichOutput with metadata"""
99 """test RichOutput with metadata"""
@@ -17,8 +17,6 b' Authors'
17 # Imports
17 # Imports
18 #-----------------------------------------------------------------------------
18 #-----------------------------------------------------------------------------
19
19
20 from IPython.testing.decorators import skip_iptest_but_not_pytest
21
22 # our own
20 # our own
23 from IPython.utils.PyColorize import Parser
21 from IPython.utils.PyColorize import Parser
24 import io
22 import io
@@ -53,7 +51,6 b' class Bar(Super):'
53 """
51 """
54
52
55
53
56 @skip_iptest_but_not_pytest
57 def test_parse_sample(style):
54 def test_parse_sample(style):
58 """and test writing to a buffer"""
55 """and test writing to a buffer"""
59 buf = io.StringIO()
56 buf = io.StringIO()
@@ -65,7 +62,6 b' def test_parse_sample(style):'
65 assert "ERROR" not in f1
62 assert "ERROR" not in f1
66
63
67
64
68 @skip_iptest_but_not_pytest
69 def test_parse_error(style):
65 def test_parse_error(style):
70 p = Parser(style=style)
66 p = Parser(style=style)
71 f1 = p.format(")", "str")
67 f1 = p.format(")", "str")
@@ -3,7 +3,6 b''
3 # Distributed under the terms of the Modified BSD License.
3 # Distributed under the terms of the Modified BSD License.
4
4
5 import pytest
5 import pytest
6 from IPython.testing.decorators import skip_iptest_but_not_pytest
7
6
8 from IPython.utils.tokenutil import token_at_cursor, line_at_cursor
7 from IPython.utils.tokenutil import token_at_cursor, line_at_cursor
9
8
@@ -132,7 +131,6 b' def test_line_at_cursor():'
132 ["int"] * (22 - 16) + ["map"] * (28 - 22),
131 ["int"] * (22 - 16) + ["map"] * (28 - 22),
133 ),
132 ),
134 )
133 )
135 @skip_iptest_but_not_pytest
136 def test_multiline_statement(c, token):
134 def test_multiline_statement(c, token):
137 cell = """a = (1,
135 cell = """a = (1,
138 3)
136 3)
General Comments 0
You need to be logged in to leave comments. Login now