File tree Expand file tree Collapse file tree 5 files changed +14
-14
lines changed Expand file tree Collapse file tree 5 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ docs = [
5454 " trio"
5555]
5656test = [
57- " pytest>=7.0,<8 " ,
57+ " pytest>=7.0,<9 " ,
5858 " pytest-cov" ,
5959 " flaky" ,
6060 " ipyparallel" ,
Original file line number Diff line number Diff line change 77import tempfile
88from unittest .mock import patch
99
10+ import pytest
11+
1012from ipykernel .kernelspec import install
1113
1214pjoin = os .path .join
1517patchers : list = []
1618
1719
18- def setup ():
20+ @pytest .fixture (autouse = True )
21+ def _global_setup ():
1922 """setup temporary env for tests"""
2023 global tmp
2124 tmp = tempfile .mkdtemp ()
@@ -34,9 +37,7 @@ def setup():
3437
3538 # install IPython in the temp home:
3639 install (user = True )
37-
38-
39- def teardown ():
40+ yield
4041 for p in patchers :
4142 p .stop ()
4243
Original file line number Diff line number Diff line change 1111KC = KM = None
1212
1313
14- def setup_function ():
14+ @pytest .fixture (autouse = True )
15+ def _setup_env ():
1516 """start the global kernel (if it isn't running) and return its client"""
1617 global KM , KC
1718 KM , KC = start_new_kernel ()
1819 flush_channels (KC )
19-
20-
21- def teardown_function ():
20+ yield
2221 assert KC is not None
2322 assert KM is not None
2423 KC .stop_channels ()
Original file line number Diff line number Diff line change @@ -42,14 +42,13 @@ def _get_qt_vers():
4242_get_qt_vers ()
4343
4444
45- def setup ():
45+ @pytest .fixture (autouse = True )
46+ def _setup_env ():
4647 """start the global kernel (if it isn't running) and return its client"""
4748 global KM , KC
4849 KM , KC = start_new_kernel ()
4950 flush_channels (KC )
50-
51-
52- def teardown ():
51+ yield
5352 assert KM is not None
5453 assert KC is not None
5554 KC .stop_channels ()
Original file line number Diff line number Diff line change 2222KC : BlockingKernelClient = None # type:ignore
2323
2424
25- def setup ():
25+ @pytest .fixture (autouse = True )
26+ def _setup_env ():
2627 global KC
2728 KC = start_global_kernel ()
2829
You can’t perform that action at this time.
0 commit comments