Replies: 2 comments 2 replies
-
pytest_configure happens way after addopts is considered there is no builtin way to do what you outline please outline the intended use-case more comprehensible as the minified example is not enough to make a good suggestion |
Beta Was this translation helpful? Give feedback.
-
Ah okay, I see. I have a fixture that uses a YAML configuration file for a particular feature and this is passed on the command line. So my tests are organised in a hierarchy where only one directory needs to have this command line argument passed and I was trying to dynamically add this to the ini file using What's an alternate way of specifying command line args dynamically per directory? |
Beta Was this translation helpful? Give feedback.
-
Hi,
I have a subset of tests where I want to apply a command line argument specific to those tests. The argument defines a file that should be loaded by a fixture.
I've been trying to use
addinivalue_line
from withinpytest_configure
but this doesn't seem to work. How is this supposed to be used?As a simple example of what I'm trying to do here is an example
conftest.py
at the top level of my tests directory:and a matching test:
I'm expecting that if I add the
--ping
CLI arg that I then getpong
set.Beta Was this translation helpful? Give feedback.
All reactions