From 542b0d51c1d4dcd7c3e22014f2eb220edd6533c6 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Fri, 8 Dec 2023 10:05:31 -0700 Subject: [PATCH] tests: Put python dependencies in requirements file Really this is just `pytest` right now (with `flake8` included for lack of a better location), but this provides a place to collect more test dependencies that's better than updating a bunch of adhoc instructions. https://phabricator.endlessm.com/T34697 --- .github/workflows/tests.yml | 6 +++--- README.md | 5 +++-- requirements-test.txt | 3 +++ 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 requirements-test.txt diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index be5f6439..dbd5eabf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -32,11 +32,11 @@ jobs: ostree \ python3-gi \ python3-pip - - name: Python dependencies - run: | - python3 -m pip install flake8 pytest - name: Checkout uses: actions/checkout@v2 + - name: Python dependencies + run: | + python3 -m pip install -r requirements-test.txt - name: Lint run: | python3 -m flake8 diff --git a/README.md b/README.md index 8238d41a..2cc4f885 100644 --- a/README.md +++ b/README.md @@ -394,8 +394,9 @@ Testing ======= Some parts of the image builder can be tested with [pytest][pytest-url]. -After installing pytest, run `pytest` (or `pytest-3` if `pytest` is for -python 2) from the root of the checkout. +Install the testing dependencies with `pip3 install -r +requirements-test.txt`. After installing pytest, run `pytest` (or +`pytest-3` if `pytest` is for python 2) from the root of the checkout. Various options can be passed to `pytest` to control how the tests are run. See the pytest [usage][pytest-usage] documentation for details. diff --git a/requirements-test.txt b/requirements-test.txt new file mode 100644 index 00000000..4b5e87ba --- /dev/null +++ b/requirements-test.txt @@ -0,0 +1,3 @@ +# Python requirements for testing +flake8 +pytest