From e32310efbf9f1cc5c6b04230a2e46f5a1d9c7668 Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Tue, 9 Nov 2021 12:54:03 +0100 Subject: [PATCH] Move IPYKERNEL_CELL_NAME from tox to pytest This allows pytest to be executed directly without tox and without manual setting of the variable. Tox works well as before. --- nbclient/tests/conftest.py | 6 ++++++ tox.ini | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 nbclient/tests/conftest.py diff --git a/nbclient/tests/conftest.py b/nbclient/tests/conftest.py new file mode 100644 index 00000000..728194ba --- /dev/null +++ b/nbclient/tests/conftest.py @@ -0,0 +1,6 @@ +import os + +# This is important for ipykernel to show the same string +# instead of randomly generated file names in outputs. +# See: https://github.com/ipython/ipykernel/blob/360685c67c71cd33691c72c1e9e88d23a88f4021/ipykernel/compiler.py#L50-L55 +os.environ["IPYKERNEL_CELL_NAME"] = "" \ No newline at end of file diff --git a/tox.ini b/tox.ini index b07aeabd..b31d3baa 100644 --- a/tox.ini +++ b/tox.ini @@ -39,7 +39,6 @@ commands = # disable Python's hash randomization for tests that stringify dicts, etc setenv = PYTHONHASHSEED = 0 - IPYKERNEL_CELL_NAME = passenv = * basepython = py36: python3.6