Skip to content

Commit

Permalink
Fix ipytest install issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jerry-git committed Sep 23, 2018
1 parent b3872b9 commit eb13cd3
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 25 deletions.
73 changes: 49 additions & 24 deletions notebooks/intermediate/html/pytest_fixtures.html
Original file line number Diff line number Diff line change
Expand Up @@ -11820,7 +11820,7 @@ <h1 id="Efficient-use-of-pytest-fixtures">Efficient use of <code>pytest</code> f
<div class=" highlight hl-ipython3"><pre><span></span><span class="c1"># Let&#39;s make sure pytest and ipytest packages are installed</span>
<span class="c1"># ipytest is required for running pytest inside Jupyter notebooks</span>
<span class="kn">import</span> <span class="nn">sys</span>
<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
<span class="o">!{</span>sys.executable<span class="o">}</span> -m pip install pytest <span class="s1">&#39;ipytest&gt;=0.3.0&#39;</span>

<span class="kn">import</span> <span class="nn">pytest</span>
<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>
Expand All @@ -11831,6 +11831,31 @@ <h1 id="Efficient-use-of-pytest-fixtures">Efficient use of <code>pytest</code> f
</div>
</div>

<div class="output_wrapper">
<div class="output">


<div class="output_area">

<div class="prompt"></div>


<div class="output_subarea output_stream output_stdout output_text">
<pre>Requirement already satisfied: pytest in /Users/jerry/.virtualenvs/learn-python3/lib/python3.5/site-packages (3.5.0)
Requirement already satisfied: ipytest&gt;=0.3.0 in /Users/jerry/.virtualenvs/learn-python3/lib/python3.5/site-packages (0.3.0)
Requirement already satisfied: attrs&gt;=17.4.0 in /Users/jerry/.virtualenvs/learn-python3/lib/python3.5/site-packages (from pytest) (17.4.0)
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)
Requirement already satisfied: setuptools in /Users/jerry/.virtualenvs/learn-python3/lib/python3.5/site-packages (from pytest) (39.0.1)
Requirement already satisfied: py&gt;=1.5.0 in /Users/jerry/.virtualenvs/learn-python3/lib/python3.5/site-packages (from pytest) (1.5.3)
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)
Requirement already satisfied: six&gt;=1.10.0 in /Users/jerry/.virtualenvs/learn-python3/lib/python3.5/site-packages (from pytest) (1.11.0)
</pre>
</div>
</div>

</div>
</div>

</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
Expand Down Expand Up @@ -11883,7 +11908,7 @@ <h2 id="Parametrizing-fixtures">Parametrizing fixtures<a class="anchor-link" hre


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

================================================================================= 2 passed in 0.02 seconds =================================================================================
============================================================================== 2 passed in 0.02 seconds ==============================================================================
</pre>
</div>
</div>
Expand Down Expand Up @@ -11961,7 +11986,7 @@ <h2 id="pytest.mark.usefixtures"><a href="https://docs.pytest.org/en/latest/fixt


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

===================================================================================== warnings summary =====================================================================================
================================================================================== warnings summary ==================================================================================
None
Module already imported so cannot be rewritten: nbval

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


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

pytest_fixtures.py ..

===================================================================================== warnings summary =====================================================================================
================================================================================== warnings summary ==================================================================================
None
Module already imported so cannot be rewritten: nbval

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


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

===================================================================================== warnings summary =====================================================================================
================================================================================== warnings summary ==================================================================================
None
Module already imported so cannot be rewritten: nbval

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


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

pytest_fixtures.py .

===================================================================================== warnings summary =====================================================================================
================================================================================== warnings summary ==================================================================================
None
Module already imported so cannot be rewritten: nbval

-- Docs: http://doc.pytest.org/en/latest/warnings.html
=========================================================================== 1 passed, 1 warnings in 0.03 seconds ===========================================================================
======================================================================== 1 passed, 1 warnings in 0.02 seconds ========================================================================
</pre>
</div>
</div>
Expand Down Expand Up @@ -12321,7 +12346,7 @@ <h2 id="Fixture-scope">Fixture scope<a class="anchor-link" href="#Fixture-scope"


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

===================================================================================== warnings summary =====================================================================================
================================================================================== warnings summary ==================================================================================
None
Module already imported so cannot be rewritten: nbval

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


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


===================================================================================== warnings summary =====================================================================================
================================================================================== warnings summary ==================================================================================
None
Module already imported so cannot be rewritten: nbval

-- Docs: http://doc.pytest.org/en/latest/warnings.html
=========================================================================== 1 passed, 1 warnings in 0.02 seconds ===========================================================================
======================================================================== 1 passed, 1 warnings in 0.02 seconds ========================================================================
</pre>
</div>
</div>
Expand Down Expand Up @@ -12481,7 +12506,7 @@ <h2 id="Using-fixtures-automatically">Using fixtures automatically<a class="anch


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

===================================================================================== warnings summary =====================================================================================
================================================================================== warnings summary ==================================================================================
None
Module already imported so cannot be rewritten: nbval

-- Docs: http://doc.pytest.org/en/latest/warnings.html
=========================================================================== 2 passed, 1 warnings in 0.02 seconds ===========================================================================
======================================================================== 2 passed, 1 warnings in 0.02 seconds ========================================================================
</pre>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion notebooks/intermediate/notebooks/pytest_fixtures.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"# Let's make sure pytest and ipytest packages are installed\n",
"# ipytest is required for running pytest inside Jupyter notebooks\n",
"import sys\n",
"!{sys.executable} -m pip install pytest ipytest>=0.3.0\n",
"!{sys.executable} -m pip install pytest 'ipytest>=0.3.0'\n",
"\n",
"import pytest\n",
"from ipytest import magics, clean_tests\n",
Expand Down

0 comments on commit eb13cd3

Please sign in to comment.