(
self, pluginmanager: PytestPluginManager, args: List[str]
)
| 1007 | return terminalreporter._tw |
| 1008 | |
| 1009 | def pytest_cmdline_parse( |
| 1010 | self, pluginmanager: PytestPluginManager, args: List[str] |
| 1011 | ) -> "Config": |
| 1012 | try: |
| 1013 | self.parse(args) |
| 1014 | except UsageError: |
| 1015 | |
| 1016 | # Handle --version and --help here in a minimal fashion. |
| 1017 | # This gets done via helpconfig normally, but its |
| 1018 | # pytest_cmdline_main is not called in case of errors. |
| 1019 | if getattr(self.option, "version", False) or "--version" in args: |
| 1020 | from _pytest.helpconfig import showversion |
| 1021 | |
| 1022 | showversion(self) |
| 1023 | elif ( |
| 1024 | getattr(self.option, "help", False) or "--help" in args or "-h" in args |
| 1025 | ): |
| 1026 | self._parser._getparser().print_help() |
| 1027 | sys.stdout.write( |
| 1028 | "\nNOTE: displaying only minimal help due to UsageError.\n\n" |
| 1029 | ) |
| 1030 | |
| 1031 | raise |
| 1032 | |
| 1033 | return self |
| 1034 | |
| 1035 | def notify_exception( |
| 1036 | self, |
no test coverage detected