Closed mtelka closed 6 months ago
Thanks for reporting! I could reproduce.
Would something like this work?
pytest.param("nox.virtualenv.CondaEnv.create", "conda", nox.virtualenv.CondaEnv, marks=has_conda),
The has_conda
marker is defined in test_virtualenv.py
.
/usr/lib/python3.9/ast.py:50: in parse
return compile(source, filename, mode, flags,
E File "$(BUILD_DIR)/tests/test_sessions.py", line 949
E ("nox.virtualenv.CondaEnv.create", "conda", nox.virtualenv.CondaEnv, marks=has_conda),
E ^
E SyntaxError: invalid syntax
Above tested with this patch:
--- nox-2024.3.2/tests/test_sessions.py.orig
+++ nox-2024.3.2/tests/test_sessions.py
@@ -946,7 +946,7 @@
nox.virtualenv.VirtualEnv,
),
("nox.virtualenv.VirtualEnv.create", "venv", nox.virtualenv.VirtualEnv),
- ("nox.virtualenv.CondaEnv.create", "conda", nox.virtualenv.CondaEnv),
+ ("nox.virtualenv.CondaEnv.create", "conda", nox.virtualenv.CondaEnv, marks=has_conda),
],
)
def test__create_venv_options(self, create_method, venv_backend, expected_backend):
I looked at #794 and I had to use it differently. Sorry for mess.
I tested with patch from #794 and now the test is properly skipped.
Current Behavior
I'm running tests for
nox
and I found thatTestSessionRunner.test__create_venv_options[nox.virtualenv.CondaEnv.create-conda-CondaEnv]
fails because I've no conda installed:Expected Behavior
All tests pass even without conda.
Steps To Reproduce
Run
nox
tests without conda installed.Environment
Anything else?
No response