Skip to content

Commit 3735a56

Browse files
pytestplugin: remove deprecated --env-config option
The option is deprecated since labgrid v0.1.0 (released in 2017). It's time to remove it. Signed-off-by: Bastian Krause <[email protected]>
1 parent 36955a4 commit 3735a56

File tree

5 files changed

+6
-22
lines changed

5 files changed

+6
-22
lines changed

CHANGES.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ New Features in 25.1
99
CTRL+D specially to halt autoboot countdown without running interactive
1010
hooks like bringing up network interfaces automatically.
1111

12+
Breaking changes in 25.1
13+
~~~~~~~~~~~~~~~~~~~~~~~~
14+
- The deprecated pytest plugin option ``--env-config`` has been removed. Use
15+
``--lg-env`` instead.
16+
1217
Release 25.0 (Released May 7, 2025)
1318
-----------------------------------
1419
As announced `before

doc/usage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ This allows debugging during the writing of tests and inspection during test run
433433

434434
Other labgrid-related pytest plugin options are:
435435

436-
``--lg-env=LG_ENV`` (was ``--env-config=ENV_CONFIG``)
436+
``--lg-env=LG_ENV``
437437
Specify a labgrid environment config file.
438438
This is equivalent to labgrid-client's ``-c``/``--config``.
439439

labgrid/pytestplugin/fixtures.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414

1515
def pytest_addoption(parser):
1616
group = parser.getgroup('labgrid')
17-
group.addoption(
18-
'--env-config',
19-
action='store',
20-
dest='env_config',
21-
help='labgrid environment config file (deprecated).')
2217
group.addoption(
2318
'--lg-env',
2419
action='store',

labgrid/pytestplugin/hooks.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import warnings
32
import logging
43
import pytest
54

@@ -75,17 +74,9 @@ def pytest_configure(config):
7574
lg_log = config.option.lg_log
7675
if lg_log:
7776
ConsoleLoggingReporter(lg_log)
78-
env_config = config.option.env_config
7977
lg_env = config.option.lg_env
8078
lg_coordinator = config.option.lg_coordinator
8179

82-
if lg_env is None:
83-
if env_config is not None:
84-
warnings.warn(pytest.PytestWarning(
85-
"deprecated option --env-config (use --lg-env instead)",
86-
__file__))
87-
lg_env = env_config
88-
8980
env = None
9081
if lg_env is None:
9182
lg_env = os.environ.get('LG_ENV')

tests/test_fixtures.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,6 @@ def test_env_fixture_no_logging(short_env, short_test):
4747
spawn.close()
4848
assert spawn.exitstatus == 0, spawn.before
4949

50-
def test_env_old_fixture(short_env, short_test):
51-
with pexpect.spawn(f'pytest --env-config {short_env} {short_test}') as spawn:
52-
spawn.expect("deprecated option --env-config")
53-
spawn.expect(pexpect.EOF)
54-
spawn.close()
55-
assert spawn.exitstatus == 0
56-
5750
def test_env_env_fixture(short_env, short_test):
5851
env=os.environ.copy()
5952
env['LG_ENV'] = short_env

0 commit comments

Comments
 (0)