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

Skip to content

Commit 24290cb

Browse files
authored
Merge pull request #13206 from sgaist/nose_cleanup_first_step
Nose cleanup first step
2 parents cbf83d6 + 7fb86c5 commit 24290cb

49 files changed

Lines changed: 1466 additions & 1395 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.pre-commit-config.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v3.2.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
12+
- repo: https://github.com/akaihola/darker
13+
rev: 1.3.1
14+
hooks:
15+
- id: darker
16+

IPython/core/tests/test_application.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
import os
55
import tempfile
66

7-
import nose.tools as nt
8-
97
from traitlets import Unicode
108

119
from IPython.core.application import BaseIPythonApplication
@@ -65,9 +63,8 @@ class TestApp(BaseIPythonApplication):
6563
f.write("c.TestApp.test = 'config file'")
6664

6765
app = TestApp()
68-
app.initialize(['--profile-dir', td])
69-
nt.assert_equal(app.test, 'config file')
66+
app.initialize(["--profile-dir", td])
67+
assert app.test == "config file"
7068
app = TestApp()
71-
app.initialize(['--profile-dir', td, '--TestApp.test=cli'])
72-
nt.assert_equal(app.test, 'cli')
73-
69+
app.initialize(["--profile-dir", td, "--TestApp.test=cli"])
70+
assert app.test == "cli"

IPython/core/tests/test_async_helpers.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
Should only trigger on python 3.5+ or will have syntax errors.
55
"""
66
from itertools import chain, repeat
7-
import nose.tools as nt
87
from textwrap import dedent, indent
98
from unittest import TestCase
109
from IPython.testing.decorators import skip_without
@@ -24,10 +23,10 @@
2423

2524
class AsyncTest(TestCase):
2625
def test_should_be_async(self):
27-
nt.assert_false(_should_be_async("False"))
28-
nt.assert_true(_should_be_async("await bar()"))
29-
nt.assert_true(_should_be_async("x = await bar()"))
30-
nt.assert_false(
26+
self.assertFalse(_should_be_async("False"))
27+
self.assertTrue(_should_be_async("await bar()"))
28+
self.assertTrue(_should_be_async("x = await bar()"))
29+
self.assertFalse(
3130
_should_be_async(
3231
dedent(
3332
"""
@@ -298,7 +297,7 @@ def test_autoawait_trio_wrong_sleep(self):
298297
import asyncio
299298
await asyncio.sleep(0)
300299
""")
301-
with nt.assert_raises(TypeError):
300+
with self.assertRaises(TypeError):
302301
res.raise_error()
303302

304303
@skip_without('trio')
@@ -308,7 +307,7 @@ def test_autoawait_asyncio_wrong_sleep(self):
308307
import trio
309308
await trio.sleep(0)
310309
""")
311-
with nt.assert_raises(RuntimeError):
310+
with self.assertRaises(RuntimeError):
312311
res.raise_error()
313312

314313

0 commit comments

Comments
 (0)