Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 2.33 KB

CONTRIBUTING.md

File metadata and controls

37 lines (25 loc) · 2.33 KB

contributing

unlike many projects, i try to make mine as easy as possible for other developers to work on by committing IDE config files and using tools such as pyprojectx to automate the installation of all the dev dependencies, so the steps to get set up are quite straightforward:

prerequisites

  • python (>=3.8)
  • vscode (optional)
    • shows inline errors for all linters used in the CI
    • applies formatting fixes on save to prevent formatting errors from occurring in the CI
    • there are tasks configured in the project to make installing dependencies and running tests more convenient

installation steps

  1. clone the repo
  2. run ./pw install
  3. if using vscode, click "Yes" when prompted to use the project venv and when prompted to install the recommended extensions

tests

since this is a pytest plugin, we have are two types of tests:

each plugin test is tied to a fixture test by the test name. for example, the following test runs the fixture test at ./tests/fixtures/test_python/test_one_test_passes.py:

# ./tests/test_python.py
def test_one_test_passes(pytester_dir: PytesterDir):
    run_and_assert_result(pytester_dir, passed=1)
    assert_log_file_exists(pytester_dir)

the pytester_dir fixture is an extension of pytester which gets the path to the current test file relative to the tests directory (./test_python.py) and ties it to a folder in ./tests/fixtures with the same name (minus the .py, ie. ./tests/fixtures/test_python), then looks for either a python or robot file in that directory with the same name as the test (test_one_test_passes.py or test_one_test_passes.robot), or a folder if the test requires multiple files.

TL;DR: the test tests/suite_name.py::test_name looks in tests/fixtures/suite_name for a file called test_name.py, test_name.robot or a folder called test_name, then runs pytest with the robotframework plugin on the tests there