You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been working on this feature for some time now. It requires more work though and I don't want to delay r3.2 further.
The current pytest testsuite is written in a DRY fashion. It is not really readable because of this. A solution I have been toying with is making a YAML file which would define all tests and their environment. This file would be more readable than the current Python code. Here is an example of how such a file could look like:
description: "Test --help flag"test: exit_statusargs: [--help]
---
description: Test --version flagtest: exit_statusargs: [--version]
---
# TODO: chdirdescription: Regression test faulty SearchPath checkstest: exit_statusenvironmental_variables:
XDG_DATA_HOME: "$empty_directory$"XDG_DATA_DIRS: .:a:bargs: [--version]
---
description:
Test j4-dmenu-desktop's integration with its supported terminal emulatorsparametrize_from_dict: "#terminal-emulator-matrix#"parametrize_skip:
# TODO: Maybe unify two dicts
- terminator:
skip_message: See https://github.com/gnome-terminator/terminator/issues/923condition:
function: check_term_emulator_availabilitykw_args:
terminal_name: "@parametrize.terminal_name@"commandline_flag: "@parametrize.commandline_flag@"test:
type: external_functionfunction: test_term_emulatorkw_args:
tested_string: "#bad-strings#"environmental_variables:
PATH: "$helpers_path$:$PATH_list$"XDG_DATA_HOME: "$test_files$"XDG_DATA_DIRS: "$empty_directory$"args: [--dmenu, "$dmenu_selected_imitator_helper$", --term-mode, "@parametrize@", --strict]
I make use of pytest's capabilities of testing non-Python code to read YAML and convert into unit tests. The tests themselves (mainly the more complicated ones) would be defined in a separate definitions.py file that would only include the testing function, which would receive a J4ddExecutor Python class instance which would have environment prefilled from the YAML file.
I wonder if there's a good library/framework for this. My solution would triple the code size for tests/system_tests/, but the definition files would be cleaner.
The text was updated successfully, but these errors were encountered:
I have been working on this feature for some time now. It requires more work though and I don't want to delay r3.2 further.
The current pytest testsuite is written in a DRY fashion. It is not really readable because of this. A solution I have been toying with is making a YAML file which would define all tests and their environment. This file would be more readable than the current Python code. Here is an example of how such a file could look like:
I make use of pytest's capabilities of testing non-Python code to read YAML and convert into unit tests. The tests themselves (mainly the more complicated ones) would be defined in a separate
definitions.py
file that would only include the testing function, which would receive aJ4ddExecutor
Python class instance which would have environment prefilled from the YAML file.I wonder if there's a good library/framework for this. My solution would triple the code size for
tests/system_tests/
, but the definition files would be cleaner.The text was updated successfully, but these errors were encountered: