|
63 | 63 | print(f"\nHost tests of espefuse.py for {arg_chip}:")
|
64 | 64 | print("Running espefuse.py tests...")
|
65 | 65 |
|
| 66 | +# The default value of the program name for argparse has changed in Python 3.14 |
| 67 | +# https://docs.python.org/dev/whatsnew/3.14.html#argparse |
| 68 | +ESPEFUSE_MODNAME = ( |
| 69 | + "__main__.py" if sys.version_info < (3, 14) else "python3 -m espefuse" |
| 70 | +) |
| 71 | + |
66 | 72 |
|
67 | 73 | @pytest.mark.host_test
|
68 | 74 | class EfuseTestCase:
|
@@ -173,11 +179,13 @@ def _run_command(self, cmd, check_msg, ret_code):
|
173 | 179 |
|
174 | 180 | class TestReadCommands(EfuseTestCase):
|
175 | 181 | def test_help(self):
|
176 |
| - self.espefuse_not_virt_py("--help", check_msg="usage: __main__.py [-h]") |
| 182 | + self.espefuse_not_virt_py("--help", check_msg=f"usage: {ESPEFUSE_MODNAME} [-h]") |
177 | 183 | self.espefuse_not_virt_py(f"--chip {arg_chip} --help")
|
178 | 184 |
|
179 | 185 | def test_help2(self):
|
180 |
| - self.espefuse_not_virt_py("", check_msg="usage: __main__.py [-h]", ret_code=1) |
| 186 | + self.espefuse_not_virt_py( |
| 187 | + "", check_msg=f"usage: {ESPEFUSE_MODNAME} [-h]", ret_code=1 |
| 188 | + ) |
181 | 189 |
|
182 | 190 | def test_dump(self):
|
183 | 191 | self.espefuse_py("dump -h")
|
@@ -1973,17 +1981,17 @@ def test_multiple_cmds_help(self):
|
1973 | 1981 |
|
1974 | 1982 | self.espefuse_py(
|
1975 | 1983 | f"-h {command1} {command2}",
|
1976 |
| - check_msg="usage: __main__.py [-h]", |
| 1984 | + check_msg=f"usage: {ESPEFUSE_MODNAME} [-h]", |
1977 | 1985 | )
|
1978 | 1986 |
|
1979 | 1987 | self.espefuse_py(
|
1980 | 1988 | f"{command1} -h {command2}",
|
1981 |
| - check_msg="usage: __main__.py burn_key_digest [-h]", |
| 1989 | + check_msg=f"usage: {ESPEFUSE_MODNAME} burn_key_digest [-h]", |
1982 | 1990 | )
|
1983 | 1991 |
|
1984 | 1992 | self.espefuse_py(
|
1985 | 1993 | f"{command1} {command2} -h",
|
1986 |
| - check_msg="usage: __main__.py burn_key [-h]", |
| 1994 | + check_msg=f"usage: {ESPEFUSE_MODNAME} burn_key [-h]", |
1987 | 1995 | )
|
1988 | 1996 |
|
1989 | 1997 | @pytest.mark.skipif(
|
|
0 commit comments