Skip to content

Commit b388730

Browse files
committed
Require ipytest>=0.3.0
1 parent 4bb7232 commit b388730

File tree

2 files changed

+25
-50
lines changed

2 files changed

+25
-50
lines changed

notebooks/intermediate/html/pytest_fixtures.html

Lines changed: 24 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -11820,7 +11820,7 @@ <h1 id="Efficient-use-of-pytest-fixtures">Efficient use of <code>pytest</code> f
1182011820
<div class=" highlight hl-ipython3"><pre><span></span><span class="c1"># Let&#39;s make sure pytest and ipytest packages are installed</span>
1182111821
<span class="c1"># ipytest is required for running pytest inside Jupyter notebooks</span>
1182211822
<span class="kn">import</span> <span class="nn">sys</span>
11823-
<span class="o">!{</span>sys.executable<span class="o">}</span> -m pip install pytest ipytest
11823+
<span class="o">!{</span>sys.executable<span class="o">}</span> -m pip install pytest ipytest&gt;<span class="o">=</span><span class="m">0</span>.3.0
1182411824

1182511825
<span class="kn">import</span> <span class="nn">pytest</span>
1182611826
<span class="kn">from</span> <span class="nn">ipytest</span> <span class="k">import</span> <span class="n">magics</span><span class="p">,</span> <span class="n">clean_tests</span>
@@ -11831,31 +11831,6 @@ <h1 id="Efficient-use-of-pytest-fixtures">Efficient use of <code>pytest</code> f
1183111831
</div>
1183211832
</div>
1183311833

11834-
<div class="output_wrapper">
11835-
<div class="output">
11836-
11837-
11838-
<div class="output_area">
11839-
11840-
<div class="prompt"></div>
11841-
11842-
11843-
<div class="output_subarea output_stream output_stdout output_text">
11844-
<pre>Requirement already satisfied: pytest in /Users/jerry/.virtualenvs/learn-python3/lib/python3.5/site-packages (3.5.0)
11845-
Requirement already satisfied: ipytest in /Users/jerry/.virtualenvs/learn-python3/lib/python3.5/site-packages (0.2.2)
11846-
Requirement already satisfied: pluggy&lt;0.7,&gt;=0.5 in /Users/jerry/.virtualenvs/learn-python3/lib/python3.5/site-packages (from pytest) (0.6.0)
11847-
Requirement already satisfied: six&gt;=1.10.0 in /Users/jerry/.virtualenvs/learn-python3/lib/python3.5/site-packages (from pytest) (1.11.0)
11848-
Requirement already satisfied: more-itertools&gt;=4.0.0 in /Users/jerry/.virtualenvs/learn-python3/lib/python3.5/site-packages (from pytest) (4.1.0)
11849-
Requirement already satisfied: attrs&gt;=17.4.0 in /Users/jerry/.virtualenvs/learn-python3/lib/python3.5/site-packages (from pytest) (17.4.0)
11850-
Requirement already satisfied: py&gt;=1.5.0 in /Users/jerry/.virtualenvs/learn-python3/lib/python3.5/site-packages (from pytest) (1.5.3)
11851-
Requirement already satisfied: setuptools in /Users/jerry/.virtualenvs/learn-python3/lib/python3.5/site-packages (from pytest) (39.0.1)
11852-
</pre>
11853-
</div>
11854-
</div>
11855-
11856-
</div>
11857-
</div>
11858-
1185911834
</div>
1186011835
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
1186111836
</div>
@@ -11908,7 +11883,7 @@ <h2 id="Parametrizing-fixtures">Parametrizing fixtures<a class="anchor-link" hre
1190811883

1190911884

1191011885
<div class="output_subarea output_stream output_stdout output_text">
11911-
<pre>=========================================================== test session starts ===========================================================
11886+
<pre>=================================================================================== test session starts ====================================================================================
1191211887
platform darwin -- Python 3.5.4, pytest-3.5.0, py-1.5.3, pluggy-0.6.0
1191311888
rootdir: /Users/jerry/github/jerry-git/learn-python3, inifile: pytest.ini
1191411889
plugins: nbval-0.9.0
@@ -11918,7 +11893,7 @@ <h2 id="Parametrizing-fixtures">Parametrizing fixtures<a class="anchor-link" hre
1191811893
./bar/baz.txt
1191911894
.
1192011895

11921-
======================================================== 2 passed in 0.02 seconds =========================================================
11896+
================================================================================= 2 passed in 0.02 seconds =================================================================================
1192211897
</pre>
1192311898
</div>
1192411899
</div>
@@ -11986,7 +11961,7 @@ <h2 id="pytest.mark.usefixtures"><a href="https://docs.pytest.org/en/latest/fixt
1198611961

1198711962

1198811963
<div class="output_subarea output_stream output_stdout output_text">
11989-
<pre>=========================================================== test session starts ===========================================================
11964+
<pre>=================================================================================== test session starts ====================================================================================
1199011965
platform darwin -- Python 3.5.4, pytest-3.5.0, py-1.5.3, pluggy-0.6.0
1199111966
rootdir: /Users/jerry/github/jerry-git/learn-python3, inifile: pytest.ini
1199211967
plugins: nbval-0.9.0
@@ -11999,12 +11974,12 @@ <h2 id="pytest.mark.usefixtures"><a href="https://docs.pytest.org/en/latest/fixt
1199911974
here we use also other_fixture which returns: FOO
1200011975
.
1200111976

12002-
============================================================ warnings summary =============================================================
11977+
===================================================================================== warnings summary =====================================================================================
1200311978
None
1200411979
Module already imported so cannot be rewritten: nbval
1200511980

1200611981
-- Docs: http://doc.pytest.org/en/latest/warnings.html
12007-
================================================== 2 passed, 1 warnings in 0.02 seconds ===================================================
11982+
=========================================================================== 2 passed, 1 warnings in 0.03 seconds ===========================================================================
1200811983
</pre>
1200911984
</div>
1201011985
</div>
@@ -12093,20 +12068,20 @@ <h3 id="monkeypatch"><a href="https://docs.pytest.org/en/latest/reference.html#_
1209312068

1209412069

1209512070
<div class="output_subarea output_stream output_stdout output_text">
12096-
<pre>=========================================================== test session starts ===========================================================
12071+
<pre>=================================================================================== test session starts ====================================================================================
1209712072
platform darwin -- Python 3.5.4, pytest-3.5.0, py-1.5.3, pluggy-0.6.0
1209812073
rootdir: /Users/jerry/github/jerry-git/learn-python3, inifile: pytest.ini
1209912074
plugins: nbval-0.9.0
1210012075
collected 2 items
1210112076

1210212077
pytest_fixtures.py ..
1210312078

12104-
============================================================ warnings summary =============================================================
12079+
===================================================================================== warnings summary =====================================================================================
1210512080
None
1210612081
Module already imported so cannot be rewritten: nbval
1210712082

1210812083
-- Docs: http://doc.pytest.org/en/latest/warnings.html
12109-
================================================== 2 passed, 1 warnings in 0.02 seconds ===================================================
12084+
=========================================================================== 2 passed, 1 warnings in 0.03 seconds ===========================================================================
1211012085
</pre>
1211112086
</div>
1211212087
</div>
@@ -12187,7 +12162,7 @@ <h3 id="monkeypatch"><a href="https://docs.pytest.org/en/latest/reference.html#_
1218712162

1218812163

1218912164
<div class="output_subarea output_stream output_stdout output_text">
12190-
<pre>=========================================================== test session starts ===========================================================
12165+
<pre>=================================================================================== test session starts ====================================================================================
1219112166
platform darwin -- Python 3.5.4, pytest-3.5.0, py-1.5.3, pluggy-0.6.0
1219212167
rootdir: /Users/jerry/github/jerry-git/learn-python3, inifile: pytest.ini
1219312168
plugins: nbval-0.9.0
@@ -12197,12 +12172,12 @@ <h3 id="monkeypatch"><a href="https://docs.pytest.org/en/latest/reference.html#_
1219712172
This is modified truth
1219812173
.
1219912174

12200-
============================================================ warnings summary =============================================================
12175+
===================================================================================== warnings summary =====================================================================================
1220112176
None
1220212177
Module already imported so cannot be rewritten: nbval
1220312178

1220412179
-- Docs: http://doc.pytest.org/en/latest/warnings.html
12205-
================================================== 1 passed, 1 warnings in 0.02 seconds ===================================================
12180+
=========================================================================== 1 passed, 1 warnings in 0.02 seconds ===========================================================================
1220612181
</pre>
1220712182
</div>
1220812183
</div>
@@ -12264,20 +12239,20 @@ <h3 id="tmpdir"><a href="https://docs.pytest.org/en/latest/tmpdir.html#the-tmpdi
1226412239

1226512240

1226612241
<div class="output_subarea output_stream output_stdout output_text">
12267-
<pre>=========================================================== test session starts ===========================================================
12242+
<pre>=================================================================================== test session starts ====================================================================================
1226812243
platform darwin -- Python 3.5.4, pytest-3.5.0, py-1.5.3, pluggy-0.6.0
1226912244
rootdir: /Users/jerry/github/jerry-git/learn-python3, inifile: pytest.ini
1227012245
plugins: nbval-0.9.0
1227112246
collected 1 item
1227212247

1227312248
pytest_fixtures.py .
1227412249

12275-
============================================================ warnings summary =============================================================
12250+
===================================================================================== warnings summary =====================================================================================
1227612251
None
1227712252
Module already imported so cannot be rewritten: nbval
1227812253

1227912254
-- Docs: http://doc.pytest.org/en/latest/warnings.html
12280-
================================================== 1 passed, 1 warnings in 0.03 seconds ===================================================
12255+
=========================================================================== 1 passed, 1 warnings in 0.03 seconds ===========================================================================
1228112256
</pre>
1228212257
</div>
1228312258
</div>
@@ -12346,7 +12321,7 @@ <h2 id="Fixture-scope">Fixture scope<a class="anchor-link" href="#Fixture-scope"
1234612321

1234712322

1234812323
<div class="output_subarea output_stream output_stdout output_text">
12349-
<pre>=========================================================== test session starts ===========================================================
12324+
<pre>=================================================================================== test session starts ====================================================================================
1235012325
platform darwin -- Python 3.5.4, pytest-3.5.0, py-1.5.3, pluggy-0.6.0
1235112326
rootdir: /Users/jerry/github/jerry-git/learn-python3, inifile: pytest.ini
1235212327
plugins: nbval-0.9.0
@@ -12362,12 +12337,12 @@ <h2 id="Fixture-scope">Fixture scope<a class="anchor-link" href="#Fixture-scope"
1236212337
func
1236312338
.
1236412339

12365-
============================================================ warnings summary =============================================================
12340+
===================================================================================== warnings summary =====================================================================================
1236612341
None
1236712342
Module already imported so cannot be rewritten: nbval
1236812343

1236912344
-- Docs: http://doc.pytest.org/en/latest/warnings.html
12370-
================================================== 2 passed, 1 warnings in 0.02 seconds ===================================================
12345+
=========================================================================== 2 passed, 1 warnings in 0.02 seconds ===========================================================================
1237112346
</pre>
1237212347
</div>
1237312348
</div>
@@ -12428,7 +12403,7 @@ <h2 id="Setup-teardown-behaviour">Setup-teardown behaviour<a class="anchor-link"
1242812403

1242912404

1243012405
<div class="output_subarea output_stream output_stdout output_text">
12431-
<pre>=========================================================== test session starts ===========================================================
12406+
<pre>=================================================================================== test session starts ====================================================================================
1243212407
platform darwin -- Python 3.5.4, pytest-3.5.0, py-1.5.3, pluggy-0.6.0
1243312408
rootdir: /Users/jerry/github/jerry-git/learn-python3, inifile: pytest.ini
1243412409
plugins: nbval-0.9.0
@@ -12441,12 +12416,12 @@ <h2 id="Setup-teardown-behaviour">Setup-teardown behaviour<a class="anchor-link"
1244112416
this will be run after test execution, you can do e.g. some clean up here
1244212417

1244312418

12444-
============================================================ warnings summary =============================================================
12419+
===================================================================================== warnings summary =====================================================================================
1244512420
None
1244612421
Module already imported so cannot be rewritten: nbval
1244712422

1244812423
-- Docs: http://doc.pytest.org/en/latest/warnings.html
12449-
================================================== 1 passed, 1 warnings in 0.02 seconds ===================================================
12424+
=========================================================================== 1 passed, 1 warnings in 0.02 seconds ===========================================================================
1245012425
</pre>
1245112426
</div>
1245212427
</div>
@@ -12506,7 +12481,7 @@ <h2 id="Using-fixtures-automatically">Using fixtures automatically<a class="anch
1250612481

1250712482

1250812483
<div class="output_subarea output_stream output_stdout output_text">
12509-
<pre>=========================================================== test session starts ===========================================================
12484+
<pre>=================================================================================== test session starts ====================================================================================
1251012485
platform darwin -- Python 3.5.4, pytest-3.5.0, py-1.5.3, pluggy-0.6.0
1251112486
rootdir: /Users/jerry/github/jerry-git/learn-python3, inifile: pytest.ini
1251212487
plugins: nbval-0.9.0
@@ -12518,12 +12493,12 @@ <h2 id="Using-fixtures-automatically">Using fixtures automatically<a class="anch
1251812493
using my_fixture
1251912494
.
1252012495

12521-
============================================================ warnings summary =============================================================
12496+
===================================================================================== warnings summary =====================================================================================
1252212497
None
1252312498
Module already imported so cannot be rewritten: nbval
1252412499

1252512500
-- Docs: http://doc.pytest.org/en/latest/warnings.html
12526-
================================================== 2 passed, 1 warnings in 0.03 seconds ===================================================
12501+
=========================================================================== 2 passed, 1 warnings in 0.02 seconds ===========================================================================
1252712502
</pre>
1252812503
</div>
1252912504
</div>

notebooks/intermediate/pytest_fixtures.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"# Let's make sure pytest and ipytest packages are installed\n",
2424
"# ipytest is required for running pytest inside Jupyter notebooks\n",
2525
"import sys\n",
26-
"!{sys.executable} -m pip install pytest ipytest\n",
26+
"!{sys.executable} -m pip install pytest ipytest>=0.3.0\n",
2727
"\n",
2828
"import pytest\n",
2929
"from ipytest import magics, clean_tests\n",

0 commit comments

Comments
 (0)