public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-libcst] f44: Test both the pure-Python parser and the Rust parser
@ 2026-07-09  5:13 Benjamin A. Beasley
  0 siblings, 0 replies; only message in thread
From: Benjamin A. Beasley @ 2026-07-09  5:13 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/python-libcst
Branch : f44
Commit : 16201f8946c9ee6194896d3e32eb108e1bb2c9c9
Author : Benjamin A. Beasley <code@musicinmybrain.net>
Date   : 2026-07-07T11:19:59+01:00
Stats  : +18/-8 in 1 file(s)
URL    : https://src.fedoraproject.org/rpms/python-libcst/c/16201f8946c9ee6194896d3e32eb108e1bb2c9c9?branch=f44

Log:
Test both the pure-Python parser and the Rust parser

---
diff --git a/python-libcst.spec b/python-libcst.spec
index 3840ad0..b58adfa 100644
--- a/python-libcst.spec
+++ b/python-libcst.spec
@@ -104,19 +104,29 @@ cd ..
 
 %check
 %pyproject_check_import -e 'libcst.tests.*'
+
 %if %{with tests}
+mod='%{buildroot}%{python3_sitearch}/libcst'
 # Omit fuzz tests. These don’t make much sense downstream, and would require
 # hypothesmith, which hasn’t been successfully rebuilt for Python 3.15.
-ignore="${ignore-} --ignore=libcst/tests/test_fuzz.py"
+ignore="${ignore-} --ignore=${mod}/tests/test_fuzz.py"
 %if %{without all_tests}
-ignore="${ignore-} --ignore=libcst/codegen/tests/test_codegen_clean.py"
-ignore="${ignore-} --ignore=libcst/metadata/tests/test_type_inference_provider.py"
+ignore="${ignore-} --ignore=${mod}/codegen/tests/test_codegen_clean.py"
+ignore="${ignore-} --ignore=${mod}/metadata/tests/test_type_inference_provider.py"
 %endif
-# libcst.native is not available in build directory
-# test the pure Python codepath for now
-# (TODO: test *both* paths)
-export LIBCST_PARSER_TYPE=pure
-%pytest ${ignore-} -v
+
+# Pure-Python parser
+LIBCST_PARSER_TYPE=pure %pytest --import-mode=append ${ignore-} -v "${mod}"
+
+# A few tests aren’t practical to run when not building in-place
+# Some kind of PYTHONPATH issue, it looks like
+ignore="${ignore-} --ignore=${mod}/codemod/tests/test_codemod_cli.py"
+# Broken path to fixtures for native tests (tries to find them at
+# %%{buildroot}%%{python3_sitearch/native/libcst/tests/fixtures)
+ignore="${ignore-} --ignore=${mod}/tests/test_roundtrip.py"
+
+# Rust (native) parser
+%pytest --import-mode=append ${ignore-} -k "${k-}" -v "${mod}"
 %endif
 
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-09  5:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-09  5:13 [rpms/python-libcst] f44: Test both the pure-Python parser and the Rust parser Benjamin A. Beasley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox