Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 360df2b

Browse files
committed
Remove iptest and other Nose-dependent code
1 parent 47037d1 commit 360df2b

24 files changed

Lines changed: 44 additions & 1630 deletions

.github/workflows/test.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ jobs:
3838
python -m pip install --upgrade check-manifest pytest-cov anyio
3939
- name: Check manifest
4040
run: check-manifest
41-
- name: iptest
42-
run: |
43-
cd /tmp && iptest --coverage xml && cd -
44-
cp /tmp/ipy_coverage.xml ./
45-
cp /tmp/.coverage ./
4641
- name: pytest
4742
env:
4843
COLUMNS: 120

CONTRIBUTING.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,15 @@ For more detailed information, see our [GitHub Workflow](https://github.com/ipyt
7676

7777
All the tests can be run by using
7878
```shell
79-
iptest
79+
pytest
8080
```
8181

8282
All the tests for a single module (for example **test_alias**) can be run by using the fully qualified path to the module.
8383
```shell
84-
iptest IPython.core.tests.test_alias
84+
pytest IPython/core/tests/test_alias.py
8585
```
8686

87-
Only a single test (for example **test_alias_lifecycle**) within a single file can be run by adding the specific test after a `:` at the end:
87+
Only a single test (for example **test_alias_lifecycle**) within a single file can be run by adding the specific test after a `::` at the end:
8888
```shell
89-
iptest IPython.core.tests.test_alias:test_alias_lifecycle
90-
```
91-
92-
For convenience, the full path to a file can often be used instead of the module path on unix systems. For example we can run all the tests by using
93-
```shell
94-
iptest IPython/core/tests/test_alias.py
89+
pytest IPython/core/tests/test_alias.py::test_alias_lifecycle
9590
```

IPython/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
from .terminal.embed import embed
5252

5353
from .core.interactiveshell import InteractiveShell
54-
from .testing import test
5554
from .utils.sysinfo import sys_info
5655
from .utils.frame import extract_module_locals
5756

IPython/core/tests/test_completer.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Distributed under the terms of the Modified BSD License.
66

77
import os
8+
import pytest
89
import sys
910
import textwrap
1011
import unittest
@@ -14,7 +15,6 @@
1415
from traitlets.config.loader import Config
1516
from IPython import get_ipython
1617
from IPython.core import completer
17-
from IPython.external import decorators
1818
from IPython.utils.tempdir import TemporaryDirectory, TemporaryWorkingDirectory
1919
from IPython.utils.generics import complete_object
2020
from IPython.testing import decorators as dec
@@ -317,8 +317,8 @@ def test_forward_unicode_completion(self):
317317
self.assertEqual(matches, ["\u2164"]) # same as above but explicit.
318318

319319
@unittest.skip("now we have a completion for \jmath")
320-
@decorators.knownfailureif(
321-
sys.platform == "win32", "Fails if there is a C:\\j... path"
320+
@pytest.mark.xfail(
321+
sys.platform == "win32", reason="Fails if there is a C:\\j... path"
322322
)
323323
def test_no_ascii_back_completion(self):
324324
ip = get_ipython()
@@ -357,8 +357,8 @@ def test_has_open_quotes4(self):
357357
for s in ['""', '""" """', '"hi" "ipython"']:
358358
self.assertFalse(completer.has_open_quotes(s))
359359

360-
@decorators.knownfailureif(
361-
sys.platform == "win32", "abspath completions fail on Windows"
360+
@pytest.mark.xfail(
361+
sys.platform == "win32", reason="abspath completions fail on Windows"
362362
)
363363
def test_abspath_file_completions(self):
364364
ip = get_ipython()

IPython/core/tests/test_magic.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
"""Tests for various magic functions.
3-
4-
Needs to be run by nose (to make ipython session available).
5-
"""
2+
"""Tests for various magic functions."""
63

74
import asyncio
85
import io

IPython/core/tests/test_magic_terminal.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
"""Tests for various magic functions specific to the terminal frontend.
2-
3-
Needs to be run by nose (to make ipython session available).
4-
"""
1+
"""Tests for various magic functions specific to the terminal frontend."""
52

63
#-----------------------------------------------------------------------------
74
# Imports

IPython/core/tests/test_run.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,23 +125,29 @@ def doctest_run_option_parser_for_posix():
125125
"""
126126

127127

128+
doctest_run_option_parser_for_posix.__skip_doctest__ = sys.platform == "win32"
129+
130+
128131
@dec.skip_if_not_win32
129132
def doctest_run_option_parser_for_windows():
130133
r"""Test option parser in %run (Windows specific).
131134
132135
In Windows, you can't escape ``*` `by backslash:
133136
134137
In [1]: %run print_argv.py print\\*.py
135-
['print\\*.py']
138+
['print\\\\*.py']
136139
137140
You can use quote to escape glob:
138141
139142
In [2]: %run print_argv.py 'print*.py'
140-
['print*.py']
143+
["'print*.py'"]
141144
142145
"""
143146

144147

148+
doctest_run_option_parser_for_windows.__skip_doctest__ = sys.platform != "win32"
149+
150+
145151
def doctest_reset_del():
146152
"""Test that resetting doesn't cause errors in __del__ methods.
147153
@@ -556,7 +562,6 @@ def test_multiprocessing_run():
556562
"""
557563
with TemporaryDirectory() as td:
558564
mpm = sys.modules.get('__mp_main__')
559-
assert mpm is not None
560565
sys.modules['__mp_main__'] = None
561566
try:
562567
path = pjoin(td, 'test.py')
@@ -575,7 +580,7 @@ def test_multiprocessing_run():
575580
finally:
576581
sys.modules['__mp_main__'] = mpm
577582

578-
@dec.knownfailureif(sys.platform == 'win32', "writes to io.stdout aren't captured on Windows")
583+
579584
def test_script_tb():
580585
"""Test traceback offset in `ipython script.py`"""
581586
with TemporaryDirectory() as td:

IPython/external/decorators/__init__.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

IPython/external/decorators/_decorators.py

Lines changed: 0 additions & 150 deletions
This file was deleted.

IPython/external/decorators/_numpy_testing_noseclasses.py

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)