From 79a56942b1ba9fb8d9ff1fff9562e5633d30f367 Mon Sep 17 00:00:00 2001 From: mhucka Date: Thu, 23 Apr 2026 19:34:38 +0000 Subject: [PATCH 1/4] Move pytest options to pyproject.toml In addition to being the more modern approach, this lets us start to consolidate tool options into a single well-known locadtion instead of burying them in a nonstandard location like `dev_tools/conf/`. --- dev_tools/conf/pytest.ini | 20 -------------------- pyproject.toml | 9 +++++++++ 2 files changed, 9 insertions(+), 20 deletions(-) delete mode 100644 dev_tools/conf/pytest.ini diff --git a/dev_tools/conf/pytest.ini b/dev_tools/conf/pytest.ini deleted file mode 100644 index 5f7e1fb2d..000000000 --- a/dev_tools/conf/pytest.ini +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -[pytest] -markers = - slow: marks tests as slow (deselect with '-m "not slow"') - -filterwarnings = - ignore:Skipped assert_qasm_is_consistent_with_unitary because qiskit.*:UserWarning diff --git a/pyproject.toml b/pyproject.toml index 30bff2879..e5c841b48 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,3 +22,12 @@ skip-magic-trailing-comma = true # Speed up pytest-cov on Python 3.12+ by enabling sys.monitoring if possible. core = "sysmon" disable_warnings = ["no-sysmon"] + +[tool.pytest.ini_options] +markers = [ + """slow: marks tests as slow (deselect with '-m "not slow"')""", +] + +filterwarnings = [ + "ignore:Skipped assert_qasm_is_consistent_with_unitary because qiskit.*:UserWarning", +] From ecf461036bf28077fe03fccdbfbd00920d2695e6 Mon Sep 17 00:00:00 2001 From: mhucka Date: Thu, 23 Apr 2026 19:35:17 +0000 Subject: [PATCH 2/4] Update check/pytest to remove explicit pytest.ini argument Now that the options are in pyproject.toml, the explicit argument is no longer necessary. --- check/pytest | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/check/pytest b/check/pytest index 76e195780..6e48b56b3 100755 --- a/check/pytest +++ b/check/pytest @@ -43,11 +43,10 @@ for arg in "$@"; do done if [ -z "${ACTUALLY_QUIET}" ]; then - pytest -c dev_tools/conf/pytest.ini --rootdir="$rootdir" "${PYTEST_ARGS[@]}" + pytest --rootdir="$rootdir" "${PYTEST_ARGS[@]}" else # Filter out lines like "...F....x... [ 42%]", with coloring. - pytest -c dev_tools/conf/pytest.ini \ - --rootdir="$rootdir" -q --color=yes "${PYTEST_ARGS[@]}" | \ + pytest --rootdir="$rootdir" -q --color=yes "${PYTEST_ARGS[@]}" | \ grep -Ev '^(\x1B\[0m)?[\.FEsx]+(\x1B\[36m)?[[:space:]]+\[[[:space:]]*[0-9]+%\](\x1B\[0m)?$' exit "${PIPESTATUS[0]}" fi From c79b3d50f28fbcc8aede68702008415de8321513 Mon Sep 17 00:00:00 2001 From: mhucka Date: Thu, 23 Apr 2026 19:37:46 +0000 Subject: [PATCH 3/4] Remove needless blank line --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e5c841b48..d078e880e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,6 @@ disable_warnings = ["no-sysmon"] markers = [ """slow: marks tests as slow (deselect with '-m "not slow"')""", ] - filterwarnings = [ "ignore:Skipped assert_qasm_is_consistent_with_unitary because qiskit.*:UserWarning", ] From 1cfa55bc1f2e50e7a72ee842a132bcd4eda4e706 Mon Sep 17 00:00:00 2001 From: mhucka Date: Mon, 27 Apr 2026 16:10:01 +0000 Subject: [PATCH 4/4] Update instructions in `CONTRIBUTING.md` --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9ac22d4ca..c1dcf7739 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -257,7 +257,7 @@ We use [pytest](https://docs.pytest.org) to run our tests and [pytest-cov](https://pytest-cov.readthedocs.io) to compute coverage. * While developing, periodically check that changes do not break anything. For fast checks, use - `pytest -c dev_tools/conf/pytest.ini PATH`, where `PATH` is a directory or pytest file to test. + `pytest -m "not slow" PATH`, where `PATH` is a directory or pytest file to test. * After finishing a task, run `check/pytest` to test all of the OpenFermion code.